[OpenSCAD] Semantics CSG ops with respect to color, materials

MichaelAtOz oz.at.michael at gmail.com
Fri May 22 04:31:25 EDT 2015


Note previous discussions  (1)
<http://forum.openscad.org/Multi-material-support-was-Re-OpenSCAD-3000-td8613.html>  

Lets talk practicality, not theory.

I'm building my second 3D printer, an  Ordbot 300x300
<http://3dtek.xyz/products/ordbot-3d-printer?variant=1016428807>  , but have
not selected my extruder yet.

I want to expand beyond single material, so two main options, 
a. multiple extruder/hotend sets (the old main material plus support
material or two+ colour setup)
b. multiple extruder with mixing hotend. (for this discussion say  Diamond
Hotend <http://reprap.org/wiki/Diamond_Hotend>  )

At the moment a. is supported, for support material this is in the slicer,
or using two+ STLs merged in some slicers. 
While b. would similarly be supported when not mixing, but just using one
extruder at a time.
So there is the c. case where it could mix up to three materials, this is
where smart things can happen.

Let"s have a simple example. No difference() or intersection() & just
implicit union()

color("red") 
	linear_extrude(height=2)
		translate([0,1,0])
		text("Hello");
color("grey",1)
	cube([32,12,2]);

<http://forum.openscad.org/file/n12724/multi_a.jpg> 
Which currently has issues with co-planar faces. Ideally it should be
printable without too much embellishment.

Note also a variation of this where the grey has an alpha < 1. This
currently displays for F5 nicely (except co-planar faces) to reflect what
would happen if a translucent material is used.
<http://forum.openscad.org/file/n12724/multi_b.jpg> 

Q? Can we, should we, automajically fix co-planar faces? Based on order?
Probably not.

So to fix the co-planar issue and clearly define what I want, it looks like
something like this is required:

module t(h=2,zAdjust=0) {
color("red") 
	translate([0,0,-zAdjust])
		linear_extrude(height=h+zAdjust*2, convexity=10)
			translate([0,1,0])
			text("Hello");
}

module c(h=2)
color("grey",0.5) // note alpha is lost 
	cube([32,12,h]);

union() { // showing to represent the implicit
		difference() { // the grey volume
			c();
			t(zAdjust=0.2);
		}
		t(); // the red volume

<http://forum.openscad.org/file/n12724/multi_c.jpg> 
Of course F6 render loses all that so something like:

module t(h=2,zAdjust=0) {
echo(h=h,zAdjust);
color("red") 
	translate([0,0,-zAdjust])
		linear_extrude(height=h+zAdjust*2, convexity=10)
			translate([0,1,0])
			text("Hello");
}

module c(h=2)
color("grey",0.5) // note alpha is lost 
	cube([32,12,h]);

module part(p=0)
	if (p==MainPart)
		children();

MainPart=0;
union() { // showing to represent the implicit
		part(p=0) difference() { // the grey volume
			c();
			t(zAdjust=0.2);
		}
		part(p=1) t(); // the red volume
}

With an export to STL for each part.

So for AMF or other multi-aware formats a simplistic approach would be to
flag the material with something similar to part() and let the user manually
make the distinct parts, as above.

Or we could try to make the union() intersection() etc, material aware. 

The simple approach would support extruder options a. & b. above, but would
not be able to control c. the mixed extruder. (baring difficult manually
slicing using a range of materials, a PITA).

(time to take a break)









-----
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.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/
--
View this message in context: http://forum.openscad.org/Semantics-CSG-ops-with-respect-to-color-materials-tp12667p12724.html
Sent from the OpenSCAD mailing list archive at Nabble.com.




More information about the Discuss mailing list