Rhino Importer/Exporter
The Rhino importer/exporter, rw3dm uses OpenNURBS
to read and write .3dm files.
rw3dm comes with the following list of programs:
on2jsonconverts OpenNURBS .3dm files to geomdl JSON formatjson2onconverts geomdl JSON format to OpenNURBS .3dm files
Use Cases
Import geometry data from .3dm files and use it with
exchange.import_json()Export geometry data with
exchange.export_json()and convert to a .3dm fileConvert OpenNURBS file format to OBJ, STL, OFF and other formats supported by geomdl
Installation
Please refer to the rw3dm repository for installation options. The binary files can be downloaded under Releases section of the GitHub repository.
Using with geomdl
The following code snippet illustrates importing the surface data converted from .3dm file:
1from geomdl import exchange
2from geomdl import multi
3from geomdl.visualization import VisMPL as vis
4
5# Import converted data
6data = exchange.import_json("converted_rhino.json")
7
8# Add the imported data to a surface container
9surf_cont = multi.SurfaceContainer(data)
10surf_cont.sample_size = 30
11
12# Visualize
13surf_cont.vis = vis.VisSurface(ctrlpts=False, trims=False)
14surf_cont.render()