Repository navigation
Conversation
Expose each line segment's midpoint as a real solver vertex so it can be snapped to and constrained like any other point: - Sketch::addLineSegment adds a free parameter for the midpoint, tied to the endpoints by an internal P2PSymmetric constraint. The constraint is solver-only (rebuilt from the geometry on load) and never serialized, so no file-format change is needed. - Vertex mapping (SketchObjectGeometry::rebuildVertexIndex, GeoList) and the point getters expose PointPos::mid for lines. - The Sketcher edit-mode coin converter draws start/end/mid for lines and keeps the midpoint hidden (per-vertex transparency) until it is hovered/selected. - SketcherGui: Vulkan-only hover-midpoint marker (gated by FREECAD_USE_VULKAN). Validated with Sketcher_tests_run (107/107) and FreeCADCmd/probe checks: Coincident(line.mid, root) moves the line so its midpoint lands on the root; the midpoint is transparent until the cursor is near it, then preselected. REVERT NOTE ----------- This adds a vertex per line, so sketch "Vertex N" sub-element numbering shifts for every line after the first (a line's mid vertex is inserted between its end and the following geometry's vertices). Documents that reference line vertices externally by number may therefore need review. To revert, drop this single commit; there is no serialized state to migrate.
|
CI investigation: the Symptom (identical on #143, #144, #145, #146 — all stacked on this branch): Bisect (locally, against an up-to-date build):
Why it can't be fixed by tweaking the rule: the midpoint equations are linear and implied for any line endpoints, yet adding them changes which point DogLeg converges to on underdetermined sketches. That silently changes existing PartDesign results (helix volume, TNP element maps) and can even fail the solve ( The commit is preserved at |
Expose each line segment's midpoint as a real solver vertex so it can be snapped to and constrained like any other point:
Sketch::addLineSegmentadds a free parameter for the midpoint, tied to the endpoints by an internal P2PSymmetric constraint. The constraint is solver-only (rebuilt from the geometry on load) and never serialized, so no file-format change is needed.SketchObjectGeometry::rebuildVertexIndex,GeoList) and the point getters exposePointPos::midfor lines.FREECAD_USE_VULKAN).Revert note: this adds a vertex per line, so sketch "Vertex N" sub-element numbering shifts for every line after the first (a line's mid vertex is inserted between its end and the following geometry's vertices). Documents that reference line vertices externally by number may need review.
Part 2 of a stacked series; base is the
Gui: viewport renderer labelbranch.