An exercise of the Tesseract.
My employer before Perceptive Software had a logo that ‘could have been’ a Tesseract.
Rotate the Tesseract by mouse-over anywhere other than center.
Source code available here on GitHub.
For my most recent enrichment, this is my first exercise using WPF. I am implementing a STL binary decoder in C#. The ASCII format decoder is ‘work-in-progress’.
Visual Studio 2008 DecoderExercise project on GitHub.
Prerequisite to building a Rhino plugin, I need to validate my understanding of the sketchfab upload process. I begin with a python script from the API page, my new token and a sample lamp OBJ file.
type in ‘pythonw upload.py’ and a successful upload delivers a screen dump of the file transfer along with an id and validating success confirmation.
My credential works and now I am ready to write my own uploader test in C#. From the API and python script, I gather the four necessary steps; 1) load CAD file, 2) convert to base64, 3) build JSON, 4) upload/post JSON.
Rhino v4 supports plugin development with Visual Studio 2008, C#, VB and C++. The simplest for me is a C# dialog application with default controls and OpenFileDialog module.
Using FileStream, CAD file is read in as a byte array.
Since some CAD files (STL, PLY) can be in binary or ASCII format, a base64 conversion is used. Thanks to C#, the conversion is available in the System.Convert library.
Following Sketchfab API, I am creating a JSON string with below function. After conversion to a byte array, HttpWebRequest uploads my content to sketchfab server.
Upon a successful upload, I receive a confirmation id and ‘success : true’.
It is exciting working on my first Rhino plugin with C#, Visual Studio 2008. The body of code samples is massive (over 150+). From McNeel’s dialog example, I am able to incorporate the test code user interface.
The challenge is getting access to the mesh data. It seems that each example requires user to select data and I am at a loss how. Might you share some wisdom ? Here is my source code for ExporterTest and RhinoExporter (experiment).
Happy to have found the most recent Rhino 5 API documentation online.
Exciting opportunity to develop exporter(s) for sketchfab. The offer is to implement exporter plugin(s) for popular CAD software in exchange for sketchfab account for a year. There are already three such implementations: AutoDesk-3dMax, Blender and Google-SketchUp. I am looking into Rhino and Meshlab.
Rhino v5 beta is available in Mac OSX and Windows. Python scripting is a big feature I have been anticipating for sometime. Sadly, I did not witness its functionality in OSX beta WIP. Any suggestion(s) ? Windows Rhino v5 is only available for licensed Rhino users. So, I downloaded Rhino v4 evaluation which does not support python. Pray to the Rhino deity that the documentation and SDK is excellent and writing a C# plugin will be a cinch !
Meshlab is an open source project with seemingly good documentation on wiki. But apparently there is nothing under ‘plugin’ ? I did find these plugin examples and this official documentation which includes instruction on C++ plugin development as well as the project location and compile. Meshlab is compiled with QT. Might QT Creator be the magical tool I seek ?
Before the actual implementation, I thought to make a prototype. The API specification is available on sketchfab, token is provided upon sign up. My prototype is in C#; got it working quickly (praise to a good language, tools and user community, thank you!) So, here is the Visual Studio 2005 C# application for uploading your CAD file to sketchfab. Feel free to use this GitHub source code for your next exporter implementation (if it is helpful).
Last year I implemented four decoders (wireframe-basic) for formats: STL, PLY, OFF and OBJ. The decoders were based on Devon Govett’s bmp decoder. The bmp decoder loaded binary data via AJAX and type cast as uint8Array.
Unfortunately, IE9 and prior versions didn’t support uint8Array type (IE10 does, horay) ! So, for the ASCII only CAD formats (OBJ, OFF), I re-wrote their decoders to keep the returned data in ASCII.
I extracted the AJAX into its own common Loader class for re-usability across multiple decoders. In addition, thanks to Eric Bidelman’s article on local file access, I am adding local file load capability to the Loader class in my OBJ decoder.
A byproduct of handling ASCII data is the possibility of line parsing with Regular Expression as I have learned from Three.js’ very own Mr. Doob. This is somewhat put into practice in my work-in-progress Three.js-OFF-decoder.
For personal enrichment in 3D file format, this is my exercise on Geomview Object File Format, OFF. OFF can be encoded in binary or ascii but this decoder handles only ascii at this point. Like the previous decoders, this OFF demo has been tested on Firefox, Safari, Chrome and **Internet Explorer 10 preview**.
Documentation, C++ source code and sample OFF files maybe found at Holmes3D.NET.
Attending Minnebar conference, I learned that STL, OBJ decoders have already been implemented with Three.js by Thingiview.js.
PLY file data can be stored in ascii, binary-big-endian or binary-little-endian. Regardless of the data type, the file header is ascii. For binary mode, data maybe stored in any type, char, short, int, float, etc. In addition to the PLY wiki page, Stanford provides excellent documentation, sample code as well as a toolkit.
As in other 3D decoder exercises, I am using Devon Govett’s bmp.js as reference and tested on browsers: Chrome, Safari, Firefox and **Internet Explorer 10 preview**.
For my enrichment in 3D file format, this is my exercise in Wavefront Technologies’ OBJ decoder. OBJ file format is simply structured in ascii and contains only data describing geometry and material. The data content is ordered in lists of vertexes (v), texture (vt), normal (vn) and faces (f). Each face entry consist of indexes to above mentioned lists to form a polygon – triangle or quad. One special quality of the file format is its support of free form curved surface object as those in NURB.
The new samples of shuttle and lamp post are found in open source project, MeshLab.