[OpenSCAD] Parting Line?

Neon22 mschafer at wireframe.biz
Mon Sep 7 21:57:51 EDT 2015


Here's a refinement using children.
Still only generates a thin shell object.
Aals the morphology operators only work on 2D shapes . Else coudl outset the
resulting shell and difference it with a cube.
I've highlighted the cube mod and used inset so it works on arbitrary stl
files.

eps=0.01;
use<scad-utils/morphology.scad>; 

// sample shape
module shape()  {
	hull() {
		sphere(10);
		translate([15,0,10]) sphere(10);
	}
	hull() {
		translate([15,0,10]) sphere(10);
		translate([45,0,0]) sphere(10);
	}
}
 
// Generate parting line object
module parting_1() {
	// Call with a child object of any kind
	scale([2+eps,2+eps,1])color("red")
	intersection(){
		// move object below origin
		translate([0,0,-50])
		linear_extrude(convexity=6)
			// create a thin border line (flat at origin)
			#difference(){
				square(size=[200,100], center=true);
				inset(d=eps)
				projection()
					children(0);
			}
		// intersect with shape
		children(0);
	}
}

//
parting_1() shape();



--
View this message in context: http://forum.openscad.org/Parting-Line-tp13715p13740.html
Sent from the OpenSCAD mailing list archive at Nabble.com.




More information about the Discuss mailing list