Usage of new misc-convert-curves API

Lingkan

CAD practitioner
Hey there!

How can I apply the newly released `misc-convert-curves` to the given B-Spline?

I already tried loading it as a part and ran `misc-convert-curves` when having selcted it as an edge, but nothing seems to happen...

See the attached file below.

1705339182537.png
 

Attachments

  • b-spline.stp
    681 KB · Views: 1

Quaoar

Administrator
Staff member
You should have a wire as an active part to run this command. E.g., the following would work:

Code:
> explode -wire
> set-as-part "WIRE 1"
> misc-convert-curves

The 1-st command extracts all wires from the imported shape. In this case, there is one wire, its name is "WIRE 1".
The 2-nd command sets "WIRE 1" as an active part for inspection.
The 3-rd command performs the conversion.

misc_convert_curves.gif
 

Lingkan

CAD practitioner
You should have a wire as an active part to run this command. -this
Would really appreciate if this usage information makes it here: docs

Anyway it seems that i somehow provided wrong test example. Let me provide the correct one below.

Also i was able to successfully apply your instructions to my use case where I:
Code:
> load-part C:/.../b-spline.stp
> explode -edge
> make-wire "WIRE 1" "EDGE 1"
> set-as-part "WIRE 1"
> misc-convert-curves

Analysis-Situs-2024.1dev-_09012024_-2024-01-18-12-05-36.gif
 

Attachments

  • b-spline-curve.stp
    20.1 KB · Views: 1

Lingkan

CAD practitioner
FYI: I somehow got VTK error when initially loading the curve shape, stating that:


Code:
ERROR: In W:\VTK\VTK-8.2.0\Filters\General\vtkTransformPolyDataFilter.cxx, line 85
vtkTransformPolyDataFilter (000001F02C1329E0): No input data

ERROR: In W:\VTK\VTK-8.2.0\Filters\General\vtkTransformPolyDataFilter.cxx, line 85
vtkTransformPolyDataFilter (000001F02C134B00): No input data

ERROR: In W:\VTK\VTK-8.2.0\Filters\General\vtkTransformPolyDataFilter.cxx, line 85
vtkTransformPolyDataFilter (000001F02C1329E0): No input data

ERROR: In W:\VTK\VTK-8.2.0\Filters\General\vtkTransformPolyDataFilter.cxx, line 85
vtkTransformPolyDataFilter (000001F02C134B00): No input data

ERROR: In W:\VTK\VTK-8.2.0\Filters\General\vtkTransformPolyDataFilter.cxx, line 85
vtkTransformPolyDataFilter (000001F02C1329E0): No input data

ERROR: In W:\VTK\VTK-8.2.0\Filters\General\vtkTransformPolyDataFilter.cxx, line 85
vtkTransformPolyDataFilter (000001F02C134B00): No input data
 

Quaoar

Administrator
Staff member
Also i was able to successfully apply your instructions to my use case where I:
Yeah, looking at your STEP file, I realized that it does not contain any wires, only a single edge. Therefore, for the conversion command to work, you need to make a wire. It looks pretty inconvenient, but in most of our cases, we are dealing with DXF drawings where all edges are packed into wires.

May I ask you what's your use case? Are you converting for CAM?
 

Lingkan

CAD practitioner
Yeah, looking at your STEP file, I realized that it does not contain any wires, only a single edge. Therefore, for the conversion command to work, you need to make a wire. It looks pretty inconvenient, but in most of our cases, we are dealing with DXF drawings where all edges are packed into wires.

May I ask you what's your use case? Are you converting for CAM?
The STEP file shouldn't really be considered a "vaild" file as i did a dirty export of my current shape after doing:

Code:
Handle(Geom_BSplineCurve) curve =
      new Geom_BSplineCurve(pw.poles, pw.weights, kn.knots, kn.mults, degree,
                            Standard_False, isRational);

  TopoDS_Shape res = BRepBuilderAPI_MakeEdge(curve);

... OFC I create a wire from it at some later point... I just quickly wanted to have something to test out your new fancy "NURBStoArcSegment" method, as we implemented such ourselfves last year ;-)

OFF TOPIC:

Seeing AS adopting and implementing such "higher order" modeling functions really makes us consider start using it's SDK in our projects. Although i somehow need to port it over to out existing Toolchain (using vcpkg) and need to figure out were to start with it:
  • Plugin DOCS?
  • API Reference (specifically Application entrypoint and where to go from there... stuff like reading into XDE document, etc.)
 
Last edited:

Quaoar

Administrator
Staff member
@Lingkan It's good to know that you find useful functions in the SDK. The online API reference got broken, as it seems, but you should be able to generate the class reference locally. Here's the CMake configuration for the SDK distribution type:

1705656582885.png

In this distribution, you do not have any dependencies on Qt, VTK or other "frontend" libs. The contents of the solution look like this:

1705657842846.png

The idea is that you can link these libraries in the same manner as you link against OpenCascade. The contents of the INSTALL_DIR contain everything for build:

1705658801541.png

The reference documentation for the SDK distribution is not as nice as it might have been, and there's definitely a lot for us to improve there. Still, the classes should be properly documented in quite a few cases. If you have any specific questions about the functionality, you'd probably better ask here; it will be more efficient than messing up with the class ref.
 
Last edited:
Top