Offset a solid with different offset values on faces

Hi
How can I create the offset from a solid with different offset values on different faces.
BRepOffsetAPI_MakeOffsetShape doesn't have the option for that.

Thanks.

Sean

wentao's picture

One way is to offset each surface of the solid, then make the new solid from these faces.

seanliu's picture

Hi Wentao:
Thanks, but which function I can use to just offset a face of a solid?

Thanks.

Sean

Mark Blome's picture

Dear Sean,

you could use BRepOffset_MakeOffset class (which is internally used by BRepOffsetAPI_MakeOffsetShape)
with its method SetOffsetOnFace():
In PythonOCC this could be done like so:
mode = BRepOffset_Skin; Intersection = 0; SelfInter = 0
builder = BRepOffset_MakeOffset()
builder.Initialize(sourceshape,thickness,eps,mode,Intersection,SelfInter,joinmethod)
for aface in localthicknesses:
builder.SetOffsetOnFace(TopoDS().face(aface), localthicknesses[aface])
builder.MakeOffsetShape()
offsetshape = builder.Shape()

Hope this helps,
Mark

jelle's picture

That's seriously cool Mark... we should add that to the examples...
Thanks for sharing...

-jf