I am new to OPEN CASCADE and facing a problem related to accessing the control points, knot, vertex etc.
I am able to import the STEP file in python using pythonocc package but not able to access the above mentioned details of the curve. It is a B_SPLINE_CURVE_WITH_KNOTS.
The object imported gets translated into TopoDS_Shape using step_reader.Shape() method but accessing its details is the main aim of my work.
I also appreciate the solution in C++ or any other programming language.
My python code to import the STEP file is as follows:
from OCC.Core.STEPControl import STEPControl_Reader from OCC.Core.IFSelect import IFSelect_RetDone, IFSelect_ItemsByEntity,IFSelect_CountByItem, IFSelect_ListByItem from OCC.Core.TopAbs import TopAbs_EDGE step_reader = STEPControl_Reader() status = step_reader.ReadFile('D:/Python projtcts/2D-Spline_STEP214.stp') if status == IFSelect_RetDone: # check status failsonly = False step_reader.PrintCheckLoad(failsonly, IFSelect_ItemsByEntity) step_reader.PrintCheckLoad(failsonly, IFSelect_CountByItem) step_reader.PrintCheckLoad(failsonly, IFSelect_ListByItem) step_reader.PrintCheckTransfer(failsonly, IFSelect_ItemsByEntity) ok = step_reader.TransferRoot(1) _nbs = step_reader.NbShapes() aResShape = step_reader.Shape(1) else: print("Error: can't read file.") sys.exit(0) n = step_reader.NbRootsForTransfer() m = step_reader.TransferRoot()