Skip to content

doc: sketch constraint example uses "Fixed", which the constraint table below it does not list #2077

Description

@nurso96

Where

The Sketch chapter, "constraint-based sketching" section (doc/sketch.rst, rendered at https://cadquery.readthedocs.io/en/stable/sketch.html). Observed on the stable build (v2.8.0, commit fb4c6d4).

The inconsistency

The worked example constrains with "Fixed":

result = (
    cq.Sketch()
    .segment((0, 0), (0, 3.0), "s1")
    .arc((0.0, 3.0), (1.5, 1.5), (0.0, 0.0), "a1")
    .constrain("s1", "Fixed", None)
    .constrain("s1", "a1", "Coincident", None)
    .constrain("a1", "s1", "Coincident", None)
    .constrain("s1", "a1", "Angle", 45)
    .solve()
    .assemble()
)

Two paragraphs below, the "Following constraints are implemented" table lists FixedPoint, Coincident, Angle, Length, Distance, Radius, Orientation, ArcAngleFixed is not in the table, and FixedPoint's documented argument (None for arc center or a 0..1 float) is not what the example passes.

A reader can't tell whether Fixed is an undocumented alias, a distinct constraint the table omits, or something deprecated that the example should stop using.

Measured on 2.8.0 (this is how the inconsistency was found)

Running the example verbatim on cadquery 2.8.0 / Python 3.12: it executes successfullysolve() converges and assemble() returns a usable face (extrudes to a valid solid). So the example's "Fixed" form is real, working API that the table doesn't document.

Suggestion

Either add a Fixed row to the constraint table (arity 1, argument None, "entity is fully fixed"), or — if FixedPoint is the intended public spelling — update the example to use it with its documented argument form. Happy to PR whichever direction maintainers prefer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions