Hi! I’m trying to offset a face 360 degrees. I tried different approaches but none of them worked properly, so I got stuck and I don't know how to continue. I'm going to explain to you what I want to achieve and what I tried until now, hoping that maybe you can offer me some suggestions or guidance. So, here it is:
- Concrete examples of what I want to achieve:
- Planar face offset
From a planar face: To a solid with rounded edges and corners:
- Nonplanar face offset (bezier in this particular case)
From a nonplanar face: To a solid with rounded edges and corners:
- What I tried:
- The first approach I tried was offsetting the face outwards and inwards by using BRepOffset_MakeOffset, creating two solids, and merging them. After that, I created pipes from the edges with BRepOffsetAPI_MakePipe and spheres with BRepPrimAPI_MakeSphere to simulate the corners. Everything went smoothly until BRepAlgoAPI_Fuse failed when I tried to fuse them all together to obtain one single solid.
- For the second approach, I tried ChFi2d_AnaFilletAlgo for the fillets but it fails on nonplanar faces, as expected. I thought that maybe the fusing is failing because of the pipes and spheres' fusion. Do you know if there’s something similar for fillet construction in the case of nonplanar edges?
- The last one was offsetting the face first so it can get a small thickness and become solid. After this operation, I created the offset of the solid using BRepOffsetAPI_MakeOffsetShape with the flag pipe BRepOffset_Pipe to round the corners of the solid.
BRepOffset_MakeOffset offsetCreator0; //for offsetting the initial face with a small offset to get some thickness offsetCreator0.Initialize(face, 0.001, Precision::Confusion(), BRepOffset_Mode::BRepOffset_Skin, false, true, GeomAbs_Intersection, true); offsetCreator0.MakeOffsetShape(); solid_from_face = TopoDS::Solid(offsetCreator0.Shape()); BRepOffsetAPI_MakeOffsetShape offsetCreator1; //for offsetting the solid created from a face in order to generate rounded edges and corners offsetCreator1.PerformByJoin(solid_from_face, offset, Precision::Confusion(), BRepOffset_Pipe, true);
This approach has two problems:
- with the offset = 0.001, when I'm trying to offset some of the faces, it returns an empty shape. When I increase it to 0.01, it’s working. Do you know what’s the rule for choosing the right offset?
- a result cannot be generated if the underlying geometry of S is BSpline, as mentioned in the documentation. Any suggestions of what to use in the case of BSplines, is there some functionality already implemented in OCC that I can use?
I think I covered everything. If there's something unclear feel free to reach out to me in the comment section. Looking forward to any suggestions for new approaches!