Fri, 10/24/2025 - 13:48
Forums:
Hi,
I'd like to remove a face restriction in one coordinate only: e.g. a half-cylindrical face would become infinite in its axial coordinate but still limited to the half circle in the other. Note the algo shouldn't be limited to cylindrical faces.
I have this code
TopoDS_Face face;
//[...]
BRepAdaptor_Surface limited(face, Standard_True);
BRepAdaptor_Surface unlimited(face, Standard_False);
Handle(Adaptor3d_Surface) result = unlimited.UTrim(limited.FirstUParameter(), limited.LastUParameter(), 1e-6);
BRepBuilderAPI_MakeFace mkFace(unlimited.Surface().Surface(), 1e-6);
TopoDS_Face unlimitedFace = mkFace.Shape();
TopoDS_Face resultFace // = ??
I can't use the result with BRepBuilderAPI_MakeFace because I can't retrieve a Handle<Geom_Surface> from a Handle<Adaptor3d_Surface>
Does exist a solution?
Fri, 10/24/2025 - 15:24
Topological face
TopoDS_Facein B-Rep is expected to have boundaries in form of topological wires->edges (TopoDS_Wire,TopoDS_Edge) - hence, it is called 'boundary representation'. In OCCT even logically closed surfaces like spheres require boundingTopoDS_Wireconsisting of auxiliary degenerated and seam edges (although some other modeling kernels may allow such definitions).It is possible creating
TopoDS_Facewithout bounding edges using only native restrictions of an underlying surface (you may trim the surface by creatingGeom_RectangularTrimmedSurface), but such face will be considered invalid and algorithms might misbehave on it.What are you trying to achieve in the final result?
Fri, 10/24/2025 - 16:57
I'm working on the Pad To Face feature of FreeCAD. Consider this case:
We ask the rectangle Pad to stop at the tube inner surface even if a part of the 2D overstep the face.
We are able to remove the restriction of the surface with the code fragment I've linked but it's not usable in this case because it will close the cylinder then the pad will stop in the empty space.
So my idea is to remove the restriction only in the axial coordinate.
We don't care about the validity of the unlimited face because it's only a temporary shape passed to the prism maker and it currently works great.