Why BRepOffsetAPI_MakeOffsetShape crashes?

Forums: 

I attempted to offset some surfaces in a STEP file, but the offset was not applied correctly. Here is the code I used and the output I got.

CODE:

from OCC.Core.TopoDS import topods_Face, TopoDS_Face
from OCC.Core.STEPControl import STEPControl_Reader
from OCC.Display.SimpleGui import init_display
from OCC.Core.TopExp import TopExp_Explorer
from OCC.Core.TopAbs import TopAbs_FACE
from OCC.Core.GeomAbs import GeomAbs_OffsetSurface, GeomAbs_Arc
from OCC.Core.BRepOffsetAPI import BRepOffsetAPI_MakeOffsetShape
from OCC.Core.BRepOffset import BRepOffset_Skin

# Initialize the display
display, start_display, add_menu, add_function_to_menu = init_display()

# Read the STEP file
step_reader = STEPControl_Reader()
step_reader.ReadFile("path.stp")
step_reader.TransferRoot()
shape = step_reader.Shape()

# Extract the faces
extract = []

explorer = TopExp_Explorer(shape, TopAbs_FACE)
count = 0
while explorer.More() and count < 103:
face = explorer.Current()
extract.append(face)
explorer.Next()
count += 1

# Create a list to store the offset shapes
offset_shapes = []

# Perform offset on the faces
for face in extract:
offset_tool = BRepOffsetAPI_MakeOffsetShape()
offset_tool.PerformBySimple(face, 100)
offset_shapes.append(offset_tool.Shape())

# Display the original faces
for face in extract:
display.DisplayShape(face, update=True)

# Display the offset faces
for offset_shape in offset_shapes:
display.DisplayShape(offset_shape, color="black")

# Start the display
start_display()

Attachments: 
Dmitrii Pasukhin's picture

Hello, there are not samples with crush? Only a problem with the generated model?

Best regards, Dmitrii.