
Tue, 08/22/2023 - 19:59
Summary:
I have noticed that the BRepOffsetAPI_MakeOffsetShape
object applies a transformation to the resulting offset shape. This transformation is not reflected when calling .Location()
in input shape or the resulting offset shape. The transformation that is being applied is in the .STEP
file as a transformation on an assembly. Normally the transformation is applied when using both GeomAbs_Intersection
and GeomAbs_Arc
as the GeomAbs_JoinType
, but I have recently had a couple of .STEP
files where GeomAbs_Intersection
does not apply the transformation at specific offsets.
Background:
I am doing a series of offsets that increment by small amounts. I initially attempt to do the offset using GeomAbs_Intersection
, if that fails then I fall back to trying the offset using GeomAbs_Arc
. In these .STEP
files where the GeomAbs_Intersection
results in an offset shape that hasn't been transformed, all other offset increments are failing to offset using GeomAbs_Intersection
and end up using GeomAbs_Arc
.
My questions:
- Under what situations does offsetting using
BRepOffsetAPI_MakeOffsetShape
get/apply the transformation? - Does anyone have any idea what could be happening in the case where
GeomAbs_Intersection
is not applying the transformation?
Code:
Here is the current setup for how BRepOffsetAPI_MakeOffsetShape
is being used:
BRepOffsetAPI_MakeOffsetShape offset_maker{};
offset_maker.PerformByJoin(
shape,
0.625, /*Offset*/
0.005, /*Tolerance*/
BRepOffset_Skin,
Standard_True,
Standard_True,
/*GeomAbs_Intersection or GeomAbs_Arc*/,
Standard_True
);
if(offset_maker.IsDone()){
return offset_maker.Shape();
}
else{
//...
}
Note: From my observations, the transform is not applied to a TopoDS_Shape
that is is generated from a STEPControl_Reader
. In order to get the transform from the .STEP
we get a XCAFDoc_DocumentTool::ShapeTool
and from that we get a gp_Trsf
from the TopLoc_Location
of a specific component.