Variable extrusion

Hello all together,

I'm currently looking for a way to not only extrude a face in a single direction, but to perform something like a variable extrusion. 

Background: I have a 3D-face (TopoDS_Shape) on the one hand,
and on the other hand, I have data on how "thick" a solid should be at distinctive, various spread positions. 

As far as I see, I could, of course, extrude the face with BRepPrimAPI_MakePrism in a specified direction, but then the resulting solid would have "identical thickness" all over.
Instead, I would like the solid to be thicker at some points, thinner at other points, depending on my "thickness-information-data."

Does anybody can point me in a direction on how to best perform my idea? Thank you very much in advance!

Separating the face in several sub-faces is not an option. 

Mikhail Sazonov's picture

I did not understand what you mean under "thicker" in some places. If you want to have different section of the solid at different value of abscissa along extrude direction then you should use the algorithm of BRepOffsetAPI_ThruSections.

Johannes Mayer's picture

Thank you very much for the reply! With that phrase, I meant not to extrude a face by a single value, but by different values in different positions. Instead of extrusion, this probably rather is a variable offset.

Thomas Anderson's picture

This is a little confusing as Make_Prism, will only make 'identical thickness' in the specific case of a plane with the direction equal to the plane normal. So I am guessing you mean offset. This would be my first attempt:
1) Create a simplified face to offset. This eliminates any problems caused by complex trim geometry.
a) Get 2d bounding box of the outer wire of the input face.
b) Create a new face from the input face surface using the u and v numbers from bounding box with some padding.
umin and vmin will be smaller than 2d bounding box
umax and vmin will be larger than 2d bounding box
This ensures that the face copy extends 'beyond' the input face.
2) Create an offset of the simplified face(step 1) or transform. *
The thickness value can be whatever makes sense, as a good starting distance.
3) Alter offset face(step 2)
Load 'step2face' into BRepFill_Filling.
Add point and/or edge constraints as desired and build.
4) Make a 'BRepPrimAPI_MakeHalfSpace' solid from altered face(step 3).
5) Build intermediate solid:
Extrude or offset input face. *
Make sure to go completely through altered face(step 3).
Extrude or offset depending on how you want the actual transition geometry to be.
6) BRepAlgoAPI_Cut the halfspace(step 4) from the intermediate solid(step 5)

* steps 2 and 5 will need to be in sync. 2 and 5 are offsets or 2 is transform and 5 is an extrusion. You will have to make sure that the altered face(step 3) completely 'covers' the intermediate solid(step 5)

good luck.

Johannes Mayer's picture

Thank you very much for this thought-out reply, I really appreciate your help. A proposal of a procedure like this, is what I hoped for. Right now, I don't have anything to add and I will try to implement it.