orbingol / rw3dm

Rhino/OpenNURBS importer and exporter for NURBS-Python (geomdl)
MIT License
32 stars 11 forks source link

on2json: Failed to convert solid CAD models to JSON #9

Closed pimakshay closed 4 years ago

pimakshay commented 4 years ago

I tried to extract the surface control points of a solid model using the on2json executable, but the operation failed. After analysing the case, I found that rw3dm does not support converting solid models; instead, the same object is constructed using the NURBS surfaces and joined to form a solid will work fine. Note: By solid model, I mean, cad models created by extruding from a curve etc.

bug.zip

Steps to reproduce the behaviour:

  1. I am attaching a sample .3DM file of a cuboid body.
  2. Run the on2json executable to extract only the surfaces: on2json cuboid.3dm extract_curves=false;
  3. The error screenshot is attached.
orbingol commented 4 years ago

@pimakshay Sorry for my late response.

I have pinpointed the issue. rw3dm determines the type of input using object_type enum defined in opennurbs_defines.h file. This file comes with OpenNURBS and provides the object types, such as surface, curve, volume, etc. The file cuboid.3dm contains an object with the type ON_Extrusion as you explained in your note.

I will add the option to extract data from extruded objects and release it in a few days.

orbingol commented 4 years ago

This issue is fixed on the devmaster branch. Here is a sample output generated from cuboid.3dm:

image