[OpenSCAD] Working around CGAL color limitations, mesh post processing.

ufomorace ant.stewart at yahoo.com
Tue Sep 8 21:41:51 EDT 2015


So i am checking this X3D format controversy. So far it's fascinating.
Attempting to save a cube file with different colors on different faces, at
first glance it would be very easy to make an X3D file parser that saves
suitable files from .scad renders:

The X3D header and footer definition code can be only 4-5 lines:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC
"http://www.web3d.org/specifications/x3d-3.3.dtd" "">
<X3D>
<Scene>
<Shape>
                 //some vertex and color arrays, see example1.x3d
example1.x3d <http://forum.openscad.org/file/n13748/example1.x3d>  
</Shape>
</Scene>
</X3D>

color by vertex has to be set to false and there has to be a colorIndex
array, perhaps there has to be multiple materials in the X3D it said. 

If you have Blender, you can make a color cube and save as X3D as an example
file, and then copy the beginning and end text into an x3d parsing routing
and write the arrays differently. I don't have blender i would be happy if
someone sends a multi material x3d file. 

Afterwards, I found out what X3D is all about. it /can/ save concise 3d
files, and it can also display 3d files in crazy ways in smartphones and web
browsers. 

It's an amazing file format, it can contain alot of lighting and scene
information and even do some kinds of extrusion of pentagons and stuff... 

I found this amazing page with examples, i am  going to attempt to turn this
into a colored cube
<http://examples.x3dom.org/example/x3dom_twoSidedMaterial.html>  and then i
can write x3d parsing program. i write very simple code so anything i do
with triangle indices post processing of an STL should be easy to port to
openSCAD. 

>From this page of examples <http://examples.x3dom.org/simpleExamples.html> 
i found  this
<http://examples.x3dom.org/example/x3dom_multiIndex-large.xhtml>   and  this
<http://examples.x3dom.org/example/x3dom_vertCols.xhtml>  ... Amazing file
format. It is equivalent to VRML2 for our 3d kinds of files, they are both
fine formats.

Ok the name X3D is boring, so i will just have to put on my 3dkini and play
some netbool :D



--
View this message in context: http://forum.openscad.org/Working-around-CGAL-color-limitations-mesh-post-processing-tp13698p13748.html
Sent from the OpenSCAD mailing list archive at Nabble.com.




More information about the Discuss mailing list