Traceback: Using 2 lines for Attachment can fail

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
hmk
Posts: 141
Joined: Tue Sep 29, 2020 1:19 pm
Location: Berlin, Germany

Traceback: Using 2 lines for Attachment can fail

Post by hmk »

I am just reporting this in case there is interest to make this more robust.

If 2 (planar) lines that have a common point are used for Attachment, it can lead to an error message that points are collinear.

Example:
- create a sketch with a hexagon
- create a datum plane and select for Reference 1 the last edge of the hexagon (Edge6), and for Reference 2 the first edge (Edge1)
- Traceback: PositionBySupport: AttachEngine3D::calculateAttachedPlacement: points are collinear. Can't make a plane

There is a simple workaround: pick 3 points instead.

(I am wondering if there are more edge cases like this...)

Screenshot from 2021-02-02 17-57-07.png
Screenshot from 2021-02-02 17-57-07.png (255.84 KiB) Viewed 632 times
Bance
Veteran
Posts: 2850
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: Traceback: Using 2 lines for Attachment can fail

Post by Bance »

Strange, if you pick edge 1 first there's no problem.
hmk
Posts: 141
Joined: Tue Sep 29, 2020 1:19 pm
Location: Berlin, Germany

Re: Traceback: Using 2 lines for Attachment can fail

Post by hmk »

Bance wrote: Tue Feb 02, 2021 5:41 pm Strange, if you pick edge 1 first there's no problem.
My guess is: The algorithms simply picks, say, the first vertex of the second line to arrive at 3 points. If this vertex happens to be identical to one of the vertices of the first line, then...

Another guess: Any combination of selection of lines work for the hexagon, except this one case. This generalizes to Sketcher_CompCreateRegularPolygon.
Post Reply