I'm making some slow but steady progress with a "CSG prototype", I wanted to
share some results I have got so far.
This test case looks at difference() wrt to surface and interior colors. I
have a color per triangle, as well as color per volume. Subtracting a blue
object leaves a blue face. Subtracting a volume with no color reveals the
internal color.
Openscad view :
http://forum.openscad.org/file/n12759/openscad.png
In CSGtest :
http://forum.openscad.org/file/n12759/csgtest.png
The top-level tree has two volumes, these are output as two volumes to AMF :
http://forum.openscad.org/file/n12759/amftool.png
Note the AMF output uses triangle colors, currently I don't output the
volume color (to be fixed).
I am not yet dealing with materials, that and the more tricky operations of
union and intersection are for future study :)
(Apologies if the images are excessive, I can link to image server if
preferred).
--
View this message in context: http://forum.openscad.org/Semantics-CSG-ops-with-respect-to-color-materials-tp12667p12759.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
On May 28, 2015, at 17:15 PM, bobc bobcousins42@googlemail.com wrote:
I'm making some slow but steady progress with a "CSG prototype", I wanted to
share some results I have got so far.
Interesting..
What is CSGtest?
-Marius
CSGTest is a C# application I have cobbled together using csg.cs (derived
from csg.js) and some code I had written before. It's quicker and easier
for me to explore ideas and issues with this. In principle the techniques
should be transferable to Openscad code later. It also gives me a better
idea of what enhancements would be required to the CSG engine, or what to
look for when considering a different CSG engine.
On 28 May 2015 at 23:03, Marius Kintel marius@kintel.net wrote:
On May 28, 2015, at 17:15 PM, bobc bobcousins42@googlemail.com wrote:
I'm making some slow but steady progress with a "CSG prototype", I
wanted to
share some results I have got so far.
Interesting..
What is CSGtest?
-Marius
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Some notes:
a. Terminology
Seems the terms heterogeneous object for one material/colour and graded
material object or composite material object are the terms for mixed output
(e.g. concurrent extrusion via one nozzle) that I have seen in academic
literature.
b. This is what Slic3r produces when merging two .STLs to .AMF (collapsed)
http://forum.openscad.org/file/n12763/slic3r_amf.jpg
c. OpenSCAD export to .AMF has an extra char at EOL
http://forum.openscad.org/file/n12763/OpenSCAD_AMF.jpg
d. Multiple concurrent extrusion is supported in reprap Firmware
http://www.reprap.org/wiki/RepRap_Firmware
The particular code is here
https://github.com/dc42/RepRapFirmware/blob/master/GCodes.cpp#L375 ,
basically uses multiple floats added to G1 for other extruders.
Still looking into other firmwares.
I'm still tracing multiple concurrent extrusion support in slicers and
CAD/CAM tools.
d. Multiple extruders supported:
Slic3r: many extruders (I stopped at 17), either loading an .AMF (with
material id defined - needing support in OpenSCAD etc), or via building an
.AMF (material id is set sequentially from 0 for each .STL loaded), or using
different extruders for perimeter/infill/support/interface (which doesn't
needs support in CAD/CAM - ie OpenSCAD))
Simplify3D: 6 extruders, outline, infill, support. Seems to only support two
colour by loading 2 .STLs.
CuraEngine: 16 extruders. Either load an .AMF which sets extruder number for
the volume, or load multiple .STLs and assign an extruder to each. Does not
seem to have the option to set different extruders for infill, support etc.
Repetier Host seems to work well for both Slic3r and CuraEngine for multi
extruders.
http://forum.openscad.org/file/n12763/repetier.jpg
e. Some examples of multi-material printing
REPRAP (Meddel?) Continuously variable 2 colour Blue/White
https://www.youtube.com/watch?v=MrFaNBNdKk0
LulzBot Taz3 FlexiDuelie (std extruder & FlexiExtruder)
(Part1 intro ABS & NinjaFlex but not as a composite)
https://www.youtube.com/watch?v=8RXIGjRG-Gc
(Part2 Alien Hand - interesting design evolution)
https://www.youtube.com/watch?v=Vd4KW0MpwLs
Voxel8 Multi-Material 3D Printer - print plastic and conductive ink and add
imbeded parts
https://www.youtube.com/watch?v=JNyeBeyR6hg
f. What Blender does:
http://wiki.blender.org/index.php/Doc:2.4/Manual/Materials/Multiple_Materials
object has multiple material(s) (a default and optional others)
material has a colour
mesh has multiple material(s)
mesh has face(s) (and edges & vertices)
face (part of the mesh that reflects colour)
face has a material, default material is assigned on creation.
http://wiki.blender.org/index.php/Doc:2.4/Tutorials/Materials/Nodes/Mixing_Materials
Node(s) can define mixed materials, with a factor (0-1) defining the blend.
Node can have a texture map influencing the blend.
material can be linked to an object or to a mesh. ("Short explanation: If
connected to the object, you can have several instances of the same obData
using different materials. If linked to mesh data, you can’t")
Object Render Format (menu). This menu has four options which define how the
object is to be rendered:
Surface - Material applied to object planes.
Wire - Material applied to wires following the object edges
Volume - Material applied to the object volume.
Halos - Material applied to halos around each object vertex. (??)
Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.
View this message in context: http://forum.openscad.org/Semantics-CSG-ops-with-respect-to-color-materials-tp12667p12763.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Some notes: update
a. Terminology
Seems the terms heterogeneous is also used when the multiple colours are
mixed at a fixed ratio.
d. Multiple concurrent extrusion is supported in reprap Firmware
http://www.reprap.org/wiki/RepRap_Firmware
as used on the RepRapPro Duet controller board, used on the Ormerod 3D
printer.
Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.
View this message in context: http://forum.openscad.org/Semantics-CSG-ops-with-respect-to-color-materials-tp12667p12764.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Thanks for the research notes, that's really useful!
b) the slic3r output does not meet AMF spec, material id ="0" is reserved
for "void", i.e. a hole. Would be worth raising a bug on that, if not
already.
f) Blender's "material" seems to be an extended surface color, perhaps like
VRML material, rather than a specification of internal properties ( I might
be wrong ).
I have been looking for source material on volumetric properties in CAD,
and not finding much. Even AMF is deficient in this regard, composite
material specification can use x,y.z coords. One article I did find was New
Trends in Computer Graphics,
http://link.springer.com/chapter/10.1007/978-3-642-83492-9_22 Not sure if
it worth paying for access, seems like there would be some more recent
research?
On 30 May 2015 at 07:17, MichaelAtOz oz.at.michael@gmail.com wrote:
Some notes:
a. Terminology
Seems the terms heterogeneous object for one material/colour and graded
material object or composite material object are the terms for mixed output
(e.g. concurrent extrusion via one nozzle) that I have seen in academic
literature.
b. This is what Slic3r produces when merging two .STLs to .AMF (collapsed)
http://forum.openscad.org/file/n12763/slic3r_amf.jpg
c. OpenSCAD export to .AMF has an extra char at EOL
http://forum.openscad.org/file/n12763/OpenSCAD_AMF.jpg
d. Multiple concurrent extrusion is supported in reprap Firmware
http://www.reprap.org/wiki/RepRap_Firmware
The particular code is here
https://github.com/dc42/RepRapFirmware/blob/master/GCodes.cpp#L375 ,
basically uses multiple floats added to G1 for other extruders.
Still looking into other firmwares.
I'm still tracing multiple concurrent extrusion support in slicers and
CAD/CAM tools.
d. Multiple extruders supported:
Slic3r: many extruders (I stopped at 17), either loading an .AMF (with
material id defined - needing support in OpenSCAD etc), or via building an
.AMF (material id is set sequentially from 0 for each .STL loaded), or
using
different extruders for perimeter/infill/support/interface (which doesn't
needs support in CAD/CAM - ie OpenSCAD))
Simplify3D: 6 extruders, outline, infill, support. Seems to only support
two
colour by loading 2 .STLs.
CuraEngine: 16 extruders. Either load an .AMF which sets extruder number
for
the volume, or load multiple .STLs and assign an extruder to each. Does not
seem to have the option to set different extruders for infill, support etc.
Repetier Host seems to work well for both Slic3r and CuraEngine for multi
extruders.
http://forum.openscad.org/file/n12763/repetier.jpg
e. Some examples of multi-material printing
REPRAP (Meddel?) Continuously variable 2 colour Blue/White
https://www.youtube.com/watch?v=MrFaNBNdKk0
LulzBot Taz3 FlexiDuelie (std extruder & FlexiExtruder)
(Part1 intro ABS & NinjaFlex but not as a composite)
https://www.youtube.com/watch?v=8RXIGjRG-Gc
(Part2 Alien Hand - interesting design evolution)
https://www.youtube.com/watch?v=Vd4KW0MpwLs
Voxel8 Multi-Material 3D Printer - print plastic and conductive ink and add
imbeded parts
https://www.youtube.com/watch?v=JNyeBeyR6hg
f. What Blender does:
http://wiki.blender.org/index.php/Doc:2.4/Manual/Materials/Multiple_Materials
object has multiple material(s) (a default and optional others)
material has a colour
mesh has multiple material(s)
mesh has face(s) (and edges & vertices)
face (part of the mesh that reflects colour)
face has a material, default material is assigned on creation.
http://wiki.blender.org/index.php/Doc:2.4/Tutorials/Materials/Nodes/Mixing_Materials
Node(s) can define mixed materials, with a factor (0-1) defining the blend.
Node can have a texture map influencing the blend.
material can be linked to an object or to a mesh. ("Short explanation: If
connected to the object, you can have several instances of the same obData
using different materials. If linked to mesh data, you can’t")
Object Render Format (menu). This menu has four options which define how
the
object is to be rendered:
Surface - Material applied to object planes.
Wire - Material applied to wires following the object edges
Volume - Material applied to the object volume.
Halos - Material applied to halos around each object vertex. (??)
Unless specifically shown otherwise above, my contribution is in the
Public Domain; To the extent possible under law, I have waived all
copyright and related or neighbouring rights to this work. This work is
published globally via the internet. :) Inclusion of works of previous
authors is not included in the above.
View this message in context:
http://forum.openscad.org/Semantics-CSG-ops-with-respect-to-color-materials-tp12667p12763.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Further adventures with color!
Firstly, a new parameter "mix", which takes values 0 to 1. This specifies
the degree of mixing in an intersection or union. Mix = 0 means take color
of left operand, mix = 1 takes color of second operand.
Some examples of intersection, with a = red cube, b = blue sphere:
From left, mix not specified (openscad default), mix=0, mix= 0.5, mix = 1
For this exercise, color mix is computed from ratio of RGB colors. Other
methods are possible, and probably would make more sense.
Intersection of colors to create new colors may not have many use cases, but
it is an important ingredient when considering unions, and the same mixing
principle can be extended to materials.
For unions, use cases are :
mix = 0. create an "overmould". For example, adding rubber material to a
case for hand grips.
mix = 1, create an inset. For example, embossing a pattern into a surface.
0 < mix < 1, create a blend. I don't have a use case for this...!
Here are the 3 cases, from left, mix = 0, mix=0.5, mix = 1. The resulting
AMF file has 7 volumes.
http://forum.openscad.org/file/n12771/csg_unions.png
That doesn't show the intersections, so here is an exploded view:
http://forum.openscad.org/file/n12771/unions.png
The next thing I want to do is to evaluate whether the AMF output files will
work well (or at all!) with slicers.
--
View this message in context: http://forum.openscad.org/Semantics-CSG-ops-with-respect-to-color-materials-tp12667p12771.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Interesting twist on multi-volume characteristics in Slic3r
http://slic3r.org/blog/modifier-meshes
Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.
View this message in context: http://forum.openscad.org/Semantics-CSG-ops-with-respect-to-color-materials-tp12667p12865.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
On Jun 10, 2015, at 21:27 PM, MichaelAtOz oz.at.michael@gmail.com wrote:
Interesting twist on multi-volume characteristics in Slic3r
http://slic3r.org/blog/modifier-meshes
Interesting..
This kind of touches on the difference between surface material and internal material. If if was possible to capture that in the design, such designs could be easier to create.
-Marius
Some examples.
A color test piece from RepRapPro.
https://github.com/bobc/csg_tool/blob/master/samples/various/original/simple-test.scad
The model is built by differencing components to create non-overlapping
volumes. With new semantics, this becomes unnecessary. The simplified
version is
https://github.com/bobc/csg_tool/blob/master/samples/various/simple-test.scad
The union() operator acts more like "append". This also means that the
operator is now non-commutative, which may be a problem. Internally, a
union() can create >1 objects as a result, if the internal properties are to
be maintained.
Output for files for VRML, STL, and AMF are at
https://github.com/bobc/csg_tool/tree/master/samples/various
Truncated cube from thingiverse : http://www.thingiverse.com/thing:19168. I
had to modify the code slightly to fix some inside out polyhedra. The
modified source and output files are in the above github repo.
Tests with slicers.
I loaded up the files (STL and AMF) into a few slicers to check for
compatibility. (I didn't try any printing yet). KissSlicer only handles STL.
Slic3er and Cura can read AMF, as well as STL. They all loaded OK, but the
CSG library I am using does not produce a good output mesh.
Summary
--
View this message in context: http://forum.openscad.org/Semantics-CSG-ops-with-respect-to-color-materials-tp12667p12867.html
Sent from the OpenSCAD mailing list archive at Nabble.com.