Can we convert 3dm file to stl or obj file using opennurbs c++ sdk - stl

I am looking for how can we use opennurbs c++ sdk to convert 3dm file format to stl or obj file format. I have already tried looking its documentation but got nothing much helpful.
documentation link [http://developer.rhino3d.com/guides/#opennurbs][1]
another link: [http://wiki.mcneel.com/developer/opennurbs/home][1]
Is it possible to convert 3dm file format to stl or obj file format using some API of opennurbs sdk or any other sdk. If yes then which API or sdk can be used ?

openNURBS by itself only supports Rhino's 3DM file format. The 3DM file format can support both mesh and NURBS geometry, but STL only supports meshes. OBJ can support both.
You can use Rhino to open the 3DM file and save as OBJ or STL. Rhino also includes a robust mesher that can convert the NURBS geometry into a mesh for STL output.
You might also consider Okino's PolyTrans software for doing file conversions automatically.

Related

How to convert STL file in JSON using Python

I need to convert stl file json using python, is there any way to do this using python programming
Here's a project that will help you to convert .stl files to JSON.
Project GitHub
Also, here's a python module called numpy-stl. It offers a wide range of functionalities for directly working on .stl files.

Use JSON file in Gephi

I have a json file containing network data that I'd like to visualize using a network visualization software like Gephi. But Gephi does not accept this type of files. Is there a way to convert the json file or are there any other network visualization softwares out there that can? I am a Mac user.
You need to use networkx in Python, construct your graph and Export your graph in a format that Gephi can load such as gexfor graphml. See the link for examples of the supported formats. Apparently R is an option, too, provided that igraph has a json reader
Visjs can import Gephi JSON and display it as a graph/network:
http://visjs.org/examples/network/data/importingFromGephi.html
You probably could adapt your JSON to fit this format.

Can i use xml3d with stl models?

I'd really like to use STL models with XML3d. Is there a way to convert back and forth between these formats?
You can convert STL files to XML3D using the Blender exporter for instance:
https://github.com/ksons/xml3d-blender-exporter
Another option is to write a plug-in for STL files that allow to reference STL files from <mesh> and <data> elements:
<mesh src="foo/bar.stl"/>
This would be very similar to the existing plug-ins for MeshLab/JSON and OpenCTM files:
http://xml3d.github.io/xml3d-examples/examples/meshlab/meshlab.html
http://xml3d.github.io/xml3d-examples/examples/openctm/openctm.html
We've just released a new converter that uses the Open Asset Import Library to convert many 3D formats (including STL) to XML3D's asset format:
https://github.com/csvurt/assimp2xml3d
It can't convert from XML3D back to other formats, but this might be something we add in the future.
There is a plug-in for STL file now:
https://github.com/xml3d/xml3d-stl-plugin
It allows using STL files as simple as:
<mesh src="../path/to/model.stl"></mesh>

Convert sketchup (*.skp) file to STL or OBJ

I'm looking for the solutions to Convert sketchup (*.skp) file to STL or OBJ.
Is there a commandline tool to convert sketchup (*.skp) file to STL or OBJ? I'm looking for the tool supporting both windows and mac.
or
How to convert sketchup (*.skp) file to STL or OBJ in javascript?
Any clue or comment is appreciated.
Thanks,
Jeffrey
AFAIK there is no command line tool to do it. Much less a Javascript tool.
SketchUp itself does have the capability, so you can create a Ruby plugin to do the export when SketchUp is opened. So you can have a .bat file or whatever the Mac equivalent is, and let it run SketchUp with your plugin.
Or you can roll your own conversion tool using the SketchUp SDK. http://www.sketchup.com/intl/en/developer/su-api/ The SDK does not need the SketchUp installed, but on the other hand it does not have any built-in .OBJ export support, so you would need to implement the exporter yourself, only using the SDK for reading the SKP file. This might be quite involved.
SketchUp has an open source STL plugin which is accessible from the Extension Warehouse:
http://extensions.sketchup.com/en/content/sketchup-stl
The STL works for SketchUp Make (which is Free) and SketchUp Pro ($590). SketchUp Pro also includes a number of other export file formats, such as OBJ, 3DS, DAE, FBX, etc....
I know its not programatically, but last version of Sketchup has the option directly to export to OBJ file.
File Menu -> export -> 3D Model -> Then select from the dropdown of extensions the OBJ.

Convert .OBJ to JSON format with libgdx

I'm working on a project where we need to convert .OBJ models into .G3DJ (JSON) format on the fly. I've tried with this code I've founded in google code.
https://code.google.com/p/libgdx-users/wiki/ImportingModelsFromBlender
ObjLoader loader = new ObjLoader();
StillModel model = loader.loadObj(Gdx.files.internal("data/model.obj"), true);
G3dExporter.export(models, Gdx.files.absolute("data/model.g3d"));
But StillModel and G3DExporter cannot be found in libgdx.
Any ideas?
The libgdx-users wiki is not up to date. Converting an OBJ file to G3DJ (or G3DB) can be done using fbx-conv, which is a command line utility (you can call it from code if you like).
Also make sure to update to the nightly build. StillModel is no longer supported (and does not support the G3DJ (JSON) file format).
It is recommended not to use OBJ (although it is still supported). Instead use FBX (converted to G3Dx), which supports more functionality than OBJ.