DiscussionsIssue archiveOther usage issues

Archived discussion

Import problem with STEP file from solid works

Other usage issuesTue, 02/14/2012 - 15:112 replies

Browse this forum
QuestionAuthor

Hi all,

I try to import and preview a toroidal surface with trim wire from a step file created with Solid works. I use python OCC and the Qt viewer interface provided with it.

The basis geometry of the toroidal surface is good but the trimming don't work. When I import the file to solid works, all works fine. If I reverse the wire, the trimming seems to work.

Has anyone got this kind of problem ? I don't know if there is a problem in solid works export, OCC import or if I have a error in my code.

thx.

Discussion

2 archived replies

Posts are displayed in their archived order.

01Commenter-1

Perhaps you could post the code generating the shape?

02Author

Yep, here my code :
Other shapes are displayed correctly, I have just a problem with a toroidal surface.

reader = STEPCAFControl_Reader()
reader.SetNameMode(True)
reader.ReadFile(STP_FILE)

document = TDocStd_Document(TCollection_ExtendedString("STEP"))
reader.Transfer(document.GetHandle())

if XCAFDoc_DocumentTool.IsXCAFDocument(document.GetHandle()):
print "doc is ok !"

rootNode = XCAFDoc_DocumentTool.ShapesLabel(document.Main())

from OCC.Display.SimpleGui import *
display, start_display, add_menu, add_function_to_menu = init_display()

rootChildren = TDF_ChildIterator(rootNode)
currentNode = rootChildren.Value()
shape = TopoDS_Shape()
XCAFDoc_ShapeTool.GetShape(currentNode, shape)
shapes = [shape]

display.DisplayColoredShape([topoSphere], 'RED')
start_display()

I can attach the step file if needed.