shaise / FreeCAD_SheetMetal

A simple sheet metal workbench for FreeCAD
http://theseger.com/projects/2015/06/sheet-metal-addon-for-freecad/
GNU Lesser General Public License v2.1
191 stars 56 forks source link

`SMFoldWall` should display an error message if the profile is not colinear lines #306

Open pierreporte opened 6 months ago

pierreporte commented 6 months ago

This issue has been thought of with the FreeCAD Design Working Group initiative for the sheet metal worbench conducted by @obelisk79 for @sliptonic. It is posted there because it is out of scope of this work.

SMFoldWall needs that the sketch contains only one fold line, continuous or discontinuous. If it is discontinuous, the segments must be colinear. If one of these conditions is not fulfilled, the feature fails. However, in certain cases, it still produces a result but obviously wrong. When there is an error message, it is not helpful. See the pictures below.

SMFoldWall should check if the profile is correct and display an error message listing what’s wrong: several profiles, non-colinear fold line, etc. and not produce anything.


image

image

image

image

image

image

image

shaise commented 6 months ago

I think this feature should be limited to a single straight line. Otherwise it should report an error

pierreporte commented 6 months ago

The wiki shows a very legitimate use of a discontinuous line: https://wiki.freecad.org/SheetMetal_AddFoldWall

Maybe it would be better to graphically select in the 3D view the parts that shouldn’t be bent.

shaise commented 6 months ago

Ohh, Yes, correct. so in this case, checking the validity of such line is not so easy.

pierreporte commented 6 months ago

I think that you can programmatically get a list of all geometry in a sketch. It may be possible to check the colinearity. Would it be enough to check numerically if all vertex sit on a line?

pierreporte commented 6 months ago

Apparently, OpenCascade provides a way to verify if a set of points lie on a line: https://dev.opencascade.org/doc/refman/html/class_g_prop___p_equation.html