FreeCAD_SheetMetal
FreeCAD_SheetMetal copied to clipboard
`SMFoldWall` should display an error message if the profile is not colinear lines
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.
I think this feature should be limited to a single straight line. Otherwise it should report an error
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.
Ohh, Yes, correct. so in this case, checking the validity of such line is not so easy.
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?
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