PR #6761 -- Part workbench Link support
Posted: Sun Apr 17, 2022 8:05 pm
https://github.com/FreeCAD/FreeCAD/pull/6761
This file crashes with this PR:
To reproduce, open the file and refresh.
How to prevent the crash?
This file results in a ruled surface that is incorrectly placed (except because of a new property I added it doesn't happen unless the new property "Reset Placement" is set to True).
Would it be better to remove the workaround code entirely? I think it's better to have the property in case it is still needed in some situations. Is there a better way to handle this situation?
Note: setting the property back to false does not reset the placement. I didn't want to change the placement in case the user has moved it.
This PR is in response to this post:
https://forum.freecadweb.org/viewtopic.php?f=3&t=67960
Basically, it adds support for App::Link sublinks by replacing calls to Part::TopoShape::getSubShape() with Part::Feature::getTopoShape(docobj, subelementname, true /*need subelement*/).getShape(). Both functions return the TopoDS_Shape of the subshape, but getTopoShape() handles the case where docobj is App::Link sublink.
This file crashes with this PR:
To reproduce, open the file and refresh.
How to prevent the crash?
This file results in a ruled surface that is incorrectly placed (except because of a new property I added it doesn't happen unless the new property "Reset Placement" is set to True).
Would it be better to remove the workaround code entirely? I think it's better to have the property in case it is still needed in some situations. Is there a better way to handle this situation?
Note: setting the property back to false does not reset the placement. I didn't want to change the placement in case the user has moved it.
This PR is in response to this post:
https://forum.freecadweb.org/viewtopic.php?f=3&t=67960
Basically, it adds support for App::Link sublinks by replacing calls to Part::TopoShape::getSubShape() with Part::Feature::getTopoShape(docobj, subelementname, true /*need subelement*/).getShape(). Both functions return the TopoDS_Shape of the subshape, but getTopoShape() handles the case where docobj is App::Link sublink.