This displays fine, until I try a top-level render (either in code or from
the menu...)
Then I get:
ERROR: CGAL error in CGALUtils::applyBinaryOperator difference: CGAL ERROR:
assertion violation! Expr: G.mark(v1,0)==G.mark(v2,0)&&
G.mark(v1,1)==G.mark(v2,1) File:
/mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_S2/SM_overlayer.h
Line: 303
Thoughts?
[code]
/////////////////////////////////////////// MAIN CODE
////////////////////////////////
include <utilities/utils.scad>
module insertHole(depth) {
//scale([25.4,25.4,25.4]) {
/#10 insert/ insH=6;insR =3.75;
coneR1=insR-.5;coneR2=insR+.5;rad=2.25;
insert(depth,insH,coneR1,coneR2,rad);
//}
}
//module roundTube(height,radius,wallTh,x,y,z)
//NAME
////////////////////////// DIMENSIONS //////////////////////////
mm=25.4;
latchW=46;
latchH=20;
latchD=6;
side=5;
w=80;
oW=150;
l=200;
slotW=64;
slotH=8.5;
slotMin=56;
gapY=18; //28 from end of slot
latchZ=28; //to top of slot...
//inset=46;
tabD=11;
rnd=3;
bagR=8;
pomR=25;
rackH=40;
fl=5;
scR=(.294mm)/2;
sR=.078mm;
tabW=24;
footR=tabW/2;
rightC=(2.5*mm) -.078; //screw radius //w/2-((w-slotW)/4);
leftC=-rightC;
module slot() {
translate([0,l/2+bagR+bagR,0])
rotate([90,0,0])
linear_extrude(height = l+20, center= true)
polygon([[-slotW/2,0],[slotW/2,0],[slotMin/2,slotH],[-slotMin/2,slotH]]);
}
module infill(length) {
render()
rotate([-90,0,0])
rotate([0,90,0])
pillarFillet(bagR,length,rnd);
}
module latchHole() {
roundVol(-latchW/2,latchW/2,-50,50,slotH,latchZ,rnd);
roundVol(-latchW/2,latchW/2,-tabD+latchD,10,slotH,50,rnd);
translate([-latchW/2,-side-side,latchZ+ side])
rotate([0,90,0]) render()
pillarFillet(side,latchW,rnd);
}
module arch() {
translate([w/2-pomR,0,rackH-pomR])
rotate([90,0,0])
invQuarterRoundCyl(pomR,tabD+rnd,rnd);
}
module leftarch() {
mirror([1,0,0]) arch();
}
module pommel() {
difference() {
union() {
translate([-w/2,bagR,bagR+slotH]) infill(w);
roundVol(-w/2,w/2,-tabD-rnd,0,-fl-rnd,rackH,rnd);
volume(-slotW/2,slotW/2,-10,bagR,-10,slotH);
}
volume(-100,100,-100,10,-100,-fl);
volume(-100,100,-100,-tabD,-100,100);
latchHole();
arch();
leftarch();
//slot();
}
}
module plusIns(yVal) {
translate([oW/2-footR,yVal,-fl-10+2])
insertHole(10);
}
module minusIns(yVal) {
mirror([1,0,0]) plusIns(yVal);
}
module inserts(yVal) {minusIns(yVal);plusIns(yVal); }
module rack() { //render()
//legs
roundMintVol(-oW/2,oW/2,0,tabW,-fl-rnd,2,footR,rnd);
roundMintVol(-oW/2,oW/2,(l/2)-(tabW/2),(l/2)+(tabW/2),-fl-rnd,2,footR,rnd);
roundMintVol(-oW/2,oW/2,l-tabW,l,-fl-rnd,2,footR,rnd);
difference() {
union() {
//main body
roundMintVol(-w/2,w/2,-20,l,-fl-rnd,8.5,footR,rnd*2);
}
//volume(-100,100,-10,200,-20,-5);
volume(-100,100,-25,-latchD,-20,20);
//mintVol(-slotMin/2,slotMin/2,tabW,80,-10,10,10);
volume(-slotMin/2,slotMin/2,0,l,-10,10);
}
}
module envelope() {
pommel();
rack();
}
module unit() {
difference() {
envelope();
volume(-100,100,-10,250,-100,-fl);
inserts(footR);inserts(l-footR);inserts(l/2);
slot();
}
}
//scale([25.4,25.4,25.4]) { //to mm
$fn = 64; //render()
unit();
//pommel();
//plusInsert(0);
//translate([100,0,-slotH]) rotate([90,0,180])
import("mtx_mount_6.stl");
//translate([0,.5,.75]) unit();
//}
//$fn = 16; render() unit();
//}
//////////////////////////////////////////UTILITIES.SCAD///////////////////////////////
mm=25.4;
$fn=16;
module mintBox(length,width,height,rad) {
hull() {
translate([rad,rad,0]) cylinder(r=rad,h=height);
translate([length-rad,rad,0]) cylinder(r=rad,h=height);
translate([rad,width-rad,0]) cylinder(r=rad,h=height);
translate([length-rad,width-rad,0]) cylinder(r=rad,h=height);
}
}
module donut(radius,thickness,x,y,z) {
total = thickness+radius; //larger than either!
translate([x,y,z+thickness/2])
rotate_extrude()
intersection() {
translate([radius-thickness/2,0,0])
circle(r = thickness/2);
translate([0,-total]) square(total2);
}
}
module mouth(rad,h) {
intersection() {
donut(rad+h,h2,0,0,-h);
cylinder(h=5,r=rad);
}
}
module quartermouth(rad,h) {
intersection() {
mouth(rad,h);
volume(0,rad,0,rad,0,h);
}
}
module quarterCyl(rad,h) {
intersection() {
cylinder(h=h,r=rad);
volume(0,rad,0,rad,0,l);
}
}
module fillet(rad,h) {
difference() {
volume(0,rad,0,rad,0,h);
cylinder(h=h,r=rad);
}
}
module mintFillet(rad,h,w,d) {
// width and depth are exterior. Interior is minus height...
//corners
translate([w-rad,d-rad,0]) quartermouth(rad,h);
translate([rad,d-rad,0]) rotate([0,0,90]) quartermouth(rad,h);
translate([w-rad,rad,0]) rotate([0,0,-90]) quartermouth(rad,h);
translate([rad,rad,0]) rotate([0,0,180]) quartermouth(rad,h);
//edges
translate([0,d-rad,0]) rotate([90,0,0]) quarterCyl(h,d-rad-rad);
translate([w,d-rad,0]) rotate([90,-90,0]) quarterCyl(h,d-rad-rad);
translate([rad,0,0]) rotate([90,0,90]) quarterCyl(h,w-rad-rad);
translate([w-rad,d,0]) rotate([90,0,-90]) quarterCyl(h,w-rad-rad);
}
module roundTube(height,radius,wallTh,x,y,z) {
donut(radius,wallTh,x,y,z);
donut(radius,wallTh,x,y,z+height-wallTh);
difference() {
translate([x,y,wallTh/2+z]) cylinder(r=radius,h=height-wallTh);
translate([x,y,wallTh/2+z])
cylinder(r=radius-wallTh,h=height-wallTh);
}
}
module pillar(rad,height,rnd) {
difference() {
cylinder(r=rad+rnd,h=height);
roundTube(height,rad+rnd+rnd,rnd*2,0,0,0);
}
}
module quarterPillar(rad,height,rnd) {
intersection() {
volume(0,rad,0,rad,0,height);
pillar(rad,height,rnd);
}
}
module pillarFillet(rad,height,rnd) {
difference() {
volume(0,rad+rnd,0,rad+rnd,0,height);
pillar(rad,height,rnd);
}
}
module roundedCube(x,y,z,rad) {
hull() {
translate([rad,rad,rad]) sphere(rad);
translate([x-rad,rad,rad]) sphere(rad);
translate([x-rad,y-rad,rad]) sphere(rad);
translate([rad,y-rad,rad]) sphere(rad);
translate([rad,rad,z-rad]) sphere(rad);
translate([x-rad,rad,z-rad]) sphere(rad);
translate([x-rad,y-rad,z-rad]) sphere(rad);
translate([rad,y-rad,z-rad]) sphere(rad);
}
}
module pill(radius,thickness,x,y,z) {
hull() { donut(radius,thickness,x,y,z); }
}
module quarterPill(radius,thickness) {
intersection() {
vol(0,radius,0,radius,0,thickness);
pill(radius,thickness,0,0,0);
}
}
module mintVol(xmin,xmax,ymin,ymax,zmin,zmax,rad) {
hull() {
translate([xmin+rad,ymin+rad,zmin]) cylinder(r=rad,h=zmax-zmin);
translate([xmax-rad,ymax-rad,zmin]) cylinder(r=rad,h=zmax-zmin);
translate([xmin+rad,ymax-rad,zmin]) cylinder(r=rad,h=zmax-zmin);
translate([xmax-rad,ymin+rad,zmin]) cylinder(r=rad,h=zmax-zmin);
}
}
module roundMintVol(xmin,xmax,ymin,ymax,zmin,zmax,rmax,rmin) {
hull() {
donut(rmax,rmin,xmin+rmax,ymin+rmax,zmin);
donut(rmax,rmin,xmax-rmax,ymax-rmax,zmin);
donut(rmax,rmin,xmin+rmax,ymax-rmax,zmin);
donut(rmax,rmin,xmax-rmax,ymin+rmax,zmin);
donut(rmax,rmin,xmin+rmax,ymin+rmax,zmax-rmin);
donut(rmax,rmin,xmax-rmax,ymax-rmax,zmax-rmin);
donut(rmax,rmin,xmin+rmax,ymax-rmax,zmax-rmin);
donut(rmax,rmin,xmax-rmax,ymin+rmax,zmax-rmin);
}
}
module roundVol(xmin,xmax,ymin,ymax,zmin,zmax,rad) {
hull() {
translate([xmin+rad,ymin+rad,zmin+rad]) sphere(r=rad);
translate([xmax-rad,ymax-rad,zmin+rad]) sphere(r=rad);
translate([xmin+rad,ymax-rad,zmin+rad]) sphere(r=rad);
translate([xmax-rad,ymin+rad,zmin+rad]) sphere(r=rad);
translate([xmin+rad,ymin+rad,zmax-rad]) sphere(r=rad);
translate([xmax-rad,ymax-rad,zmax-rad]) sphere(r=rad);
translate([xmin+rad,ymax-rad,zmax-rad]) sphere(r=rad);
translate([xmax-rad,ymin+rad,zmax-rad]) sphere(r=rad);
}
}
module volume(x,xTop,y,yTop,z,zTop) {
box(x,xTop-x,y,yTop-y,z,zTop-z);
}
module box(a,x,b,y,c,z) {
translate([a,b,c]) cube([x,y,z]);
}
module roundCyl(rad,height,rnd) {
hull() {
pill(rad,rnd2,0,0,0);
pill(rad,rnd2,0,0,height-rnd-rnd);
}
}
module quarterRoundCyl(rad,height,rnd){
intersection() {
volume(0,rad,0,rad,0,height);
roundCyl(rad,height,rnd);
}
}
module invQuarterRoundCyl(rad,height,rnd){
difference() {
volume(0,rad,0,rad,0,height);
roundCyl(rad,height,rnd);
}
}
module ring(iD,oD,height,rnd) {
diam=(oD-iD)/2;
difference() {
translate([0,0,rnd/2]) cylinder(r=oD,h=height);
translate([0,0,rnd/2]) cylinder(r1=largeR,r2=smallR,h=height);
}
donut(diam,rnd,0,0,0);
donut(diam,rnd,0,0,height);
}
module teensy() {
x=35.56;y=17.78;z=1.57;//circuit board
usbY=8.06;usbI=(y-usbY)/2;//usb jack
scale([1/mm,1/mm,1/mm]) translate([-x/2,-y/2,-z/2]) color([.3,.5,.3]) {
cube([x,y,z]);
volume(-.06,5,usbI,usbI+usbY,z,z+2.5);
}
}
module breadboard() {
cube([3.22,2.02,.08]);
}
module flatheadHole(length,shaftRad,headRad,headTh,recess) {
translate([0,0,-length-.001]) cylinder(r=shaftRad,h=length+.002);
//for flathead
translate([0,0,.001-headTh]) cylinder(r1=shaftRad,r2=headRad,h=headTh);
translate([0,0,0]) cylinder(r=headRad,h=recess);
}
module insert(scrLength,insH,coneR1,coneR2,scr) {
union() {
translate([0,0,-.01]) cylinder(r=scr,h=scrLength+.02);
translate([0,0,scrLength])
// cylinder($fn=6,r=hexR,h=hexLength);
cylinder(d1=coneR1,d2=coneR2,h=insH);
}
}
module insertHole(xpos,ypos,zpos) {
top=.25;bottom=.21;height=.312;sR=.084;
translate([xpos,ypos,zpos-height]) cylinder(d1=bottom,d2=top,h=height);
translate([xpos,ypos,-1]) cylinder(r=sR,h=zpos+1);
}
module sm58() color([.3,0,.7]) {
rimD=2.01; //diameter
ballD=1.925;
rimH=.18;
handleD=1.33; //diameter
handleH=.24;
collarH=.21;
collarD=1.525;
rimToTube=1.145;//bottom of tube to center of rim
intersection() {
sphere(d=ballD);
volume(-2,2,-2,2,-rimToTube,2);
}
translate([0,0,-rimH/2]) cylinder(d=rimD,h=rimH);
translate([0,0,-rimToTube-.75]) cylinder(d=handleD,h=handleH+.75);
//handle
translate([0,0,-rimToTube+handleH])
cylinder(d1=handleD,d2=collarD,h=collarH);//collar
translate([0,0,-rimToTube+handleH+collarH])
cylinder(d=collarD,h=.5);//collar smoother
}
//tests
module mintFilletTest() {
x=50;y=18;rad=2;
mintFillet(rad,1.6,x,y);
mintVol(0,x,0,y,-3,0,rad);
}
module mouthTest() {
quartermouth(4,1);
}
module filletTest(){
fillet(1,4);
}
module pillarTest() {
pillarFillet(16,100,3);
}
//render() quarterPillar(5,10,3);
//render() pillarTest();
//filletTest();
//mouthTest();
[/code]
--
Sent from: http://forum.openscad.org/
If it helps, the same main file using this (slightly modified) version of
utlities.scad fails silently without giving any error at all....
utils.scad http://forum.openscad.org/file/t2632/utils.scad
--
Sent from: http://forum.openscad.org/
Did some more sleuthing....
I found it will render module pommel() or module rack(), BUT NOT BOTH!
I tried encosing them in a union, in case that mattered, but it doesn't
help....
I tried moving pommel() inside rack(), but that doesn't help either.
I tried rendering both modules before unioning them, that didn't help.
I should mention I'm using 2019.05 under win10 64.
Frustrating that it doesn't indicate what in my code caused the error.
Here's the latest trace:
Loaded design 'C:/Users/emoon/Documents/Drawings/OPENSCAD/topeakRack.scad'.
Compiling design (CSG Tree generation)...
Compiling design (CSG Products generation)...
ERROR: CGAL error in CGALUtils::applyBinaryOperator union: CGAL ERROR:
assertion violation! Expr: itl != it->second.end() File:
/mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1152
Geometries in cache: 146
Geometry cache size in bytes: 33118200
CGAL Polyhedrons in cache: 8
CGAL cache size in bytes: 85562872
Compiling design (CSG Products normalization)...
Normalized CSG tree has 1 elements
Compile and preview finished.
Total rendering time: 0 hours, 1 minutes, 1 seconds
--
Sent from: http://forum.openscad.org/
Generally, if something works with one object but not two, one of the
objects is probably non-manifold. We only use cgal for the rendering if
there is more than one object. You can try rendering each object alone with
a simple cube to find which one is failing
On Tue, 9 Jun 2020, 16:34 woodslanding, temiqui@gmail.com wrote:
Did some more sleuthing....
I found it will render module pommel() or module rack(), BUT NOT BOTH!
I tried encosing them in a union, in case that mattered, but it doesn't
help....
I tried moving pommel() inside rack(), but that doesn't help either.
I tried rendering both modules before unioning them, that didn't help.
I should mention I'm using 2019.05 under win10 64.
Frustrating that it doesn't indicate what in my code caused the error.
Here's the latest trace:
Loaded design 'C:/Users/emoon/Documents/Drawings/OPENSCAD/topeakRack.scad'.
Compiling design (CSG Tree generation)...
Compiling design (CSG Products generation)...
ERROR: CGAL error in CGALUtils::applyBinaryOperator union: CGAL ERROR:
assertion violation! Expr: itl != it->second.end() File:
/mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1152
Geometries in cache: 146
Geometry cache size in bytes: 33118200
CGAL Polyhedrons in cache: 8
CGAL cache size in bytes: 85562872
Compiling design (CSG Products normalization)...
Normalized CSG tree has 1 elements
Compile and preview finished.
Total rendering time: 0 hours, 1 minutes, 1 seconds
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Thanks for the tip. I have tried to track it down from there, and got to
this point:
This works:
rack();
//translate([-w/2,bagR,bagR+slotH])
infill(w);
but this doesn't:
rack();
translate([-w/2,bagR,bagR+slotH]) infill(w);
How can just moving one of the (all rendering individually without
complaint) parts create a non-manifold???
infill is fine by itself, it's fine with rack, but if I move it it's not?
What do I do??
--
Sent from: http://forum.openscad.org/
Additionally, both the lines
rack();
and
translate([-w/2,bagR,bagR+slotH]) infill(w);
can be unioned with a cube without issue.
Full current code attached.... topeakRack.scad
http://forum.openscad.org/file/t2632/topeakRack.scad
woodslanding wrote
This works:
rack();
//translate([-w/2,bagR,bagR+slotH])
infill(w);
but this doesn't:
rack();
translate([-w/2,bagR,bagR+slotH]) infill(w);
How can just moving one of the (all rendering individually without
complaint) parts create a non-manifold???
infill is fine by itself, it's fine with rack, but if I move it it's not?
What do I do??
--
Sent from: http://forum.openscad.org/
Are the two objects touching? If they are, then they can union to form a
non-manifold. For example two cubes touching on an edge or a corner makes a
non-manifold.
On Tue, 9 Jun 2020 at 23:13, woodslanding temiqui@gmail.com wrote:
Additionally, both the lines
rack();
and
translate([-w/2,bagR,bagR+slotH]) infill(w);
can be unioned with a cube without issue.
Full current code attached.... topeakRack.scad
http://forum.openscad.org/file/t2632/topeakRack.scad
woodslanding wrote
This works:
rack();
//translate([-w/2,bagR,bagR+slotH])
infill(w);
but this doesn't:
rack();
translate([-w/2,bagR,bagR+slotH]) infill(w);
How can just moving one of the (all rendering individually without
complaint) parts create a non-manifold???
infill is fine by itself, it's fine with rack, but if I move it it's
not?
What do I do??
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
nophead wrote
Are the two objects touching? If they are, then they can union to form a
non-manifold. For example two cubes touching on an edge or a corner makes
a
non-manifold.
I read around a bit, and just realized this. What I can't understand is why
virtually every model I've ever designed hasn't had this problem.
I'm sorry, but from an intuitive standpoint that is utterly insane. Two 1
unit cubes 1 unit apart is not a valid manifold???
So yeah, I moved the bridge piece .00001mm in some random direction and it
compiles.
I'm sure there's some mathmatical reason why this matters. There's also got
to be some mathmatical way of dealing with the idea that when two objects
share a face, the face goes away.
Anyway, thanks for the help. I can't believe I've created hundreds of
models without encountering this before!
--
Sent from: http://forum.openscad.org/
Well, that actually didn't fix it. I had commented out the render line.
I've tried wiggling its position in all 3 dimensions to no effect.
topeakRack.scad http://forum.openscad.org/file/t2632/topeakRack.scad
utils.scad http://forum.openscad.org/file/t2632/utils.scad
I've always gotten a warning about manifolds before, not an incomprehensible
stack trace....
nophead wrote
Sorry I meant: They can't share just an edge or a single vertex as it
creates a zero thickness section that isn't physically possible,
On Tue, 9 Jun 2020 at 23:48, nop head <
nop.head@
> wrote:
Two cubes can share a face or a part of a face, or they can overlap. They
can't share just and edge of a single vertex as it creates a zero
thickness
section that isn't physically possible,
On Tue, 9 Jun 2020 at 23:32, woodslanding <
temiqui@
> wrote:
nophead wrote
Are the two objects touching? If they are, then they can union to form
a
non-manifold. For example two cubes touching on an edge or a corner
makes
a
non-manifold.
I read around a bit, and just realized this. What I can't understand is
why
virtually every model I've ever designed hasn't had this problem.
I'm sorry, but from an intuitive standpoint that is utterly insane. Two
1
unit cubes 1 unit apart is not a valid manifold???
So yeah, I moved the bridge piece .00001mm in some random direction and
it
compiles.
I'm sure there's some mathmatical reason why this matters. There's also
got
to be some mathmatical way of dealing with the idea that when two
objects
share a face, the face goes away.
Anyway, thanks for the help. I can't believe I've created hundreds of
models without encountering this before!
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@.openscad
Discuss@.openscad
--
Sent from: http://forum.openscad.org/
Two cubes can share a face or a part of a face, or they can overlap. They
can't share just and edge of a single vertex as it creates a zero thickness
section that isn't physically possible,
On Tue, 9 Jun 2020 at 23:32, woodslanding temiqui@gmail.com wrote:
nophead wrote
Are the two objects touching? If they are, then they can union to form a
non-manifold. For example two cubes touching on an edge or a corner makes
a
non-manifold.
I read around a bit, and just realized this. What I can't understand is
why
virtually every model I've ever designed hasn't had this problem.
I'm sorry, but from an intuitive standpoint that is utterly insane. Two 1
unit cubes 1 unit apart is not a valid manifold???
So yeah, I moved the bridge piece .00001mm in some random direction and it
compiles.
I'm sure there's some mathmatical reason why this matters. There's also
got
to be some mathmatical way of dealing with the idea that when two objects
share a face, the face goes away.
Anyway, thanks for the help. I can't believe I've created hundreds of
models without encountering this before!
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org