Hi
I have made a system of tubes to connect water hoses. See attachment.
However water will not flow, as the tubes are not hollow. When I connect
the tubes, the difference() used for each part, is not cutting into the
other tubes.
I only see one possible way to do this, which is to use a global
difference. Thus I have to design the whole system, and the copy the
design in a difference().
I really need a way to do an erase, which would simplify this a lot.
--
-------------------- Med Liberalistiske Hilsner ----------------------
Civilingeniør, Kjeld Flarup - Mit sind er mere åbent end min tegnebog
Sofienlundvej 6B, 7560 Hjerm, Tlf: 40 29 41 49
Den ikke akademiske hjemmeside for liberalismen - www.liberalismen.dk
You need to make the cylinders you are subtracting a smidge taller than what you subtract them from and shift them down half that smidge. Like so. (You don't need the use statement for this part at least.)
diameter=25.6/2;
tykkelse=1.5;
baselen=25;
centerhul=10 - 0.1;
module studs(){
studs_d = 25.6/2;
studs_l=30;
difference(){
union(){
cylinder(h = studs_l, r1 = studs_d, r2 =studs_d);
translate([0,0,studs_l])
cylinder(h = 4, r1 = studs_d+1, r2 =studs_d);
translate([0,0,studs_l+4])
cylinder(h = 4, r1 = studs_d+1, r2 =studs_d);
translate([0,0,studs_l+8])
cylinder(h = 4, r1 = studs_d+1, r2 =studs_d);
}
translate([0,0,-0.05])cylinder(h = studs_l+12.1, r1 = studs_d-3, r2 =studs_d-3);
}
}
// Tube
translate([-40,0,0])
rotate([0,90,0])
difference(){
cylinder(h = 120, r1 = diameter, r2 =diameter);
translate([0,0,-0.05])cylinder(h = 120.1, r1 = diameter-3, r2 =diameter-3);
}
studs();
translate([40,0,0])
studs();
translate([80,0,0])
rotate([0,90,0])
studs();
translate([-40,0,0])
rotate([0,-90,0])
studs();
Lenore
It appears you are trying to create an assembly from pipes using a module
to create the segments. There's no way to make that work in base OpenSCAD,
but it is possible using BOSL2, as shown in example 6 for diff():
https://github.com/revarbat/BOSL2/wiki/attachments.scad#module-diff
On Fri, May 5, 2023 at 5:54 AM Kjeld Flarup kjeld.flarup@liberalismen.dk
wrote:
Hi
I have made a system of tubes to connect water hoses. See attachment.
However water will not flow, as the tubes are not hollow. When I connect
the tubes, the difference() used for each part, is not cutting into the
other tubes.
I only see one possible way to do this, which is to use a global
difference. Thus I have to design the whole system, and the copy the
design in a difference().
I really need a way to do an erase, which would simplify this a lot.
--
-------------------- Med Liberalistiske Hilsner ----------------------
Civilingeniør, Kjeld Flarup - Mit sind er mere åbent end min tegnebog
Sofienlundvej 6B, 7560 Hjerm, Tlf: 40 29 41 49
Den ikke akademiske hjemmeside for liberalismen - www.liberalismen.dk
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
… and you have to cut the shapes of the vertical studs in the
horizontal tube:
use <MCAD/regular_shapes.scad>
diameter=25.6/2;
tykkelse=1.5;
baselen=25;
centerhul=10 - 0.1;
module studs(){
studs_d = 25.6/2;
studs_l=30;
difference(){
union(){
cylinder(h = studs_l, r1 = studs_d, r2 =studs_d);
translate([0,0,studs_l])
cylinder(h = 4, r1 = studs_d+1, r2 =studs_d);
translate([0,0,studs_l+4])
cylinder(h = 4, r1 = studs_d+1, r2 =studs_d);
translate([0,0,studs_l+8])
cylinder(h = 4, r1 = studs_d+1, r2 =studs_d);
}
// cylinder for cutting should overlap on both sides
translate([0,0,-1])
cylinder(h = studs_l+12+2, r1 = studs_d-3, r2 =studs_d-3);
}
}
// Tube
difference(){
union(){
// cutting the studs shape too
studs();
translate([40,0,0])
studs();
translate([-40,0,0])
rotate([0,90,0])
cylinder(h = 120, r1 = diameter, r2 =diameter);
}
// cylinder for cutting should overlap on both sides
translate([-92,0,0])
rotate([0,90,0])
cylinder(h = 222, r1 = diameter-3, r2 =diameter-3);
}
translate([80,0,0])
rotate([0,90,0])
studs();
translate([-40,0,0])
rotate([0,-90,0])
studs();
Peter
On Fri, 5 May 2023 06:05:17 -0400
Lenore Horner lenorehorner@sbcglobal.net wrote:
You need to make the cylinders you are subtracting a smidge taller
than what you subtract them from and shift them down half that
smidge. Like so. (You don't need the use statement for this part at
least.)
diameter=25.6/2;
tykkelse=1.5;
baselen=25;
centerhul=10 - 0.1;
module studs(){
studs_d = 25.6/2;
studs_l=30;
difference(){
union(){
cylinder(h = studs_l, r1 = studs_d, r2 =studs_d);
translate([0,0,studs_l])
cylinder(h = 4, r1 = studs_d+1, r2 =studs_d);
translate([0,0,studs_l+4])
cylinder(h = 4, r1 = studs_d+1, r2 =studs_d);
translate([0,0,studs_l+8])
cylinder(h = 4, r1 = studs_d+1, r2 =studs_d);
}
translate([0,0,-0.05])cylinder(h = studs_l+12.1, r1 = studs_d-3,
r2 =studs_d-3); }
}
// Tube
translate([-40,0,0])
rotate([0,90,0])
difference(){
cylinder(h = 120, r1 = diameter, r2 =diameter);
translate([0,0,-0.05])cylinder(h = 120.1, r1 = diameter-3, r2
=diameter-3); }
studs();
translate([40,0,0])
studs();
translate([80,0,0])
rotate([0,90,0])
studs();
translate([-40,0,0])
rotate([0,-90,0])
studs();
Lenore
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
A simple method for tubular shapes, is to create the core with
cylinders/whatever, then difference it from a minkowski () copy of the
core and chop off the ends.
something like the following
module inner(){ // shape of core
translate([30,0,0])cylinder(h=30,d=10);
translate([60,0,0])cylinder(h=30,d=10);
rotate([0,90,0]) cylinder(h=100,d=10);
translate([30,0,0])bevel(10,10,3);
translate([60,0,0])bevel(10,10,3);
}
//inner();
module all(){
intersection(){ // trim to size
translate([50,0,-20])
cube(80,true);
difference(){
minkowski(convexity=10){
inner();
sphere(d=3); // make wall ( 1.5)
}
inner();
}
}
}
all();
module bevel(ld,td,th){ // gives a bit iof strength to corners
//ld = long diameter
//td = T off diameter
//th = T height from edge of long piece
hull(){
cylinder(h=th+(ld/2),d=td); // length of T to centre
translate([-td/2-th,0,0])
rotate([0,90,0])
cylinder (h=td+th+th,d=ld);
}
}
On 05/05/2023 10:53, Kjeld Flarup wrote:
Hi
I have made a system of tubes to connect water hoses. See attachment.
However water will not flow, as the tubes are not hollow. When I
connect the tubes, the difference() used for each part, is not cutting
into the other tubes.
I only see one possible way to do this, which is to use a global
difference. Thus I have to design the whole system, and the copy the
design in a difference().
I really need a way to do an erase, which would simplify this a lot.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org