NH
nop head
Fri, Feb 4, 2022 8:28 AM
I am not sure it can ever work for an arbitrary unknown object. Consider an
L shaped box whose outside shape is made by differencing two cubes.
When you add your panel how does it know which subtracted parts should
still subtract? I.e. the one used to make the outside L should not be
subtracted, only the ones making the inside. Unless they are marked in some
way by the person designing the original object I can't see how OpenSCAD
can do it.
Also it is common to oversize the subtracted parts, for example cylinders
to make holes. These oversized subtracted objects might remove parts of
your addition that they shouldn't.
On Fri, 4 Feb 2022 at 08:01, Carsten Fuchs carsten.fuchs@cafu.de wrote:
Am 03.02.22 um 22:53 schrieb Adrian Mariano:
I am not sure it can ever work for an arbitrary unknown object. Consider an
L shaped box whose outside shape is made by differencing two cubes.
When you add your panel how does it know which subtracted parts should
still subtract? I.e. the one used to make the outside L should not be
subtracted, only the ones making the inside. Unless they are marked in some
way by the person designing the original object I can't see how OpenSCAD
can do it.
Also it is common to oversize the subtracted parts, for example cylinders
to make holes. These oversized subtracted objects might remove parts of
your addition that they shouldn't.
On Fri, 4 Feb 2022 at 08:01, Carsten Fuchs <carsten.fuchs@cafu.de> wrote:
> Am 03.02.22 um 22:53 schrieb Adrian Mariano:
> >
> https://github.com/revarbat/BOSL2/wiki/Tutorial-Attachments#tagged-operations
>
> Thanks for the link! It looks very interesting, but also complicated, and
> I'm not sure if it works with modules made outside of BOSL2, i.e. ones that
> don't come with attachments?
>
> Best regards,
> Carsten
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
RW
Raymond West
Fri, Feb 4, 2022 12:31 PM
On 04/02/2022 00:49, Torsten Paul wrote:
On 03.02.22 20:43, Raymond West wrote:
The question was if there's some way to automate this positive/
negative module idea. And the example just something specific
to start with.
Yes, it can be done in a different way, but that's not the
point and totally off-topic for the question.
This +/- parts topic comes up now and then and it would be
useful to give it some sort of conclusion. I don't care much
either way. If we find out, it's not possible, then we can
point to this discussion later. If we find out there's a way
to generalize, that's the input for a good feature request.
ciao,
Torsten.
Well, it depends if you have a problem you need to solve in the
foreseeable future, or if you can be prepared to wait, maybe for ever,
for a more succinct solution to arrive, which most likely will cause
more complication. It's a bit like the continuos requests for some
measurement system to be implemented. In that case, how do you define
what you want to measure? In this positive/negative module problem, how
do you define where you need the negative module, maybe only needed part
way though an object, say, or in some contorted path through a stack of
objects. In those cases, you will most likely have to fudge it in some
way, too. The beauty of openscad is the relative simplicity of the
'building blocks', and a few powerful operations. There are many bells
and whistles that can be added, but none of them seem to be implemented,
so I accept that and use an appropriate tool to do the job in hand.
Going back to the led clip example. In theory the negative clip is part
of the clip, but in practice the clip does nothing with it, it is the
case that uses it. The clip is just a convenient storage place for the
information. In the example, it is clear that the thickness of the case,
and in this example its curvature, and the diameter of the clip that
determines the length of the hole, so the clip should only have the
diameter of the hole, and it's minimum length. In other examples, then
other attributes of the hole may be required, some dependent on the
case, others on the clip, others on outside factors (temperature,
humidity, say). Anyone is allowed to think what they want, but the hole
is committed to the case, although some of the hole features are
involved with the clip. With a more complex 'clip', I expect it would be
even more tricky. Even if something can be defined as the
positive/negative module, I think it will be of little use in many
situations since you will need to be very careful how/where you can use
it. Sometimes there are no shortcuts, nor a silver bullet...
However, it is quite interesting. Maybe a more complicated example would
help me understand what I may be missing.
Best wishes,
Ray
On 04/02/2022 00:49, Torsten Paul wrote:
> On 03.02.22 20:43, Raymond West wrote:
>> /////like this
>
> The question was if there's some way to automate this positive/
> negative module idea. And the example just something specific
> to start with.
>
> Yes, it can be done in a different way, but that's not the
> point and totally off-topic for the question.
>
> This +/- parts topic comes up now and then and it would be
> useful to give it some sort of conclusion. I don't care much
> either way. If we find out, it's not possible, then we can
> point to this discussion later. If we find out there's a way
> to generalize, that's the input for a good feature request.
>
> ciao,
> Torsten.
Well, it depends if you have a problem you need to solve in the
foreseeable future, or if you can be prepared to wait, maybe for ever,
for a more succinct solution to arrive, which most likely will cause
more complication. It's a bit like the continuos requests for some
measurement system to be implemented. In that case, how do you define
what you want to measure? In this positive/negative module problem, how
do you define where you need the negative module, maybe only needed part
way though an object, say, or in some contorted path through a stack of
objects. In those cases, you will most likely have to fudge it in some
way, too. The beauty of openscad is the relative simplicity of the
'building blocks', and a few powerful operations. There are many bells
and whistles that can be added, but none of them seem to be implemented,
so I accept that and use an appropriate tool to do the job in hand.
Going back to the led clip example. In theory the negative clip is part
of the clip, but in practice the clip does nothing with it, it is the
case that uses it. The clip is just a convenient storage place for the
information. In the example, it is clear that the thickness of the case,
and in this example its curvature, and the diameter of the clip that
determines the length of the hole, so the clip should only have the
diameter of the hole, and it's minimum length. In other examples, then
other attributes of the hole may be required, some dependent on the
case, others on the clip, others on outside factors (temperature,
humidity, say). Anyone is allowed to think what they want, but the hole
is committed to the case, although some of the hole features are
involved with the clip. With a more complex 'clip', I expect it would be
even more tricky. Even if something can be defined as the
positive/negative module, I think it will be of little use in many
situations since you will need to be very careful how/where you can use
it. Sometimes there are no shortcuts, nor a silver bullet...
However, it is quite interesting. Maybe a more complicated example would
help me understand what I may be missing.
Best wishes,
Ray
CF
Carsten Fuchs
Fri, Feb 4, 2022 12:41 PM
Am 04.02.22 um 09:24 schrieb Victor Buciuc:
Changed the code to work with BOSL2 and seems to work:
That's great! Thank you! :-)
Best regards,
Carsten
Am 04.02.22 um 09:24 schrieb Victor Buciuc:
> Changed the code to work with BOSL2 and seems to work:
That's great! Thank you! :-)
Best regards,
Carsten
CF
Carsten Fuchs
Fri, Feb 4, 2022 12:51 PM
Agreed, parts to be subtracted upstream would either
-
have to be marked (maybe similar to the ! * # % modifiers?) or
-
designed from start to work in such a situation (i.e. only well-considered oversizing, shaping the L without subtraction, etc.)
Best regards,
Carsten
Am 04.02.22 um 09:28 schrieb nop head:
I am not sure it can ever work for an arbitrary unknown object. Consider an L shaped box whose outside shape is made by differencing two cubes.
When you add your panel how does it know which subtracted parts should still subtract? I.e. the one used to make the outside L should not be subtracted, only the ones making the inside. Unless they are marked in some way by the person designing the original object I can't see how OpenSCAD can do it.
Also it is common to oversize the subtracted parts, for example cylinders to make holes. These oversized subtracted objects might remove parts of your addition that they shouldn't.
Agreed, parts to be subtracted upstream would either
- have to be marked (maybe similar to the ! * # % modifiers?) or
- designed from start to work in such a situation (i.e. only well-considered oversizing, shaping the L without subtraction, etc.)
Best regards,
Carsten
Am 04.02.22 um 09:28 schrieb nop head:
> I am not sure it can ever work for an arbitrary unknown object. Consider an L shaped box whose outside shape is made by differencing two cubes.
>
> When you add your panel how does it know which subtracted parts should still subtract? I.e. the one used to make the outside L should not be subtracted, only the ones making the inside. Unless they are marked in some way by the person designing the original object I can't see how OpenSCAD can do it.
>
> Also it is common to oversize the subtracted parts, for example cylinders to make holes. These oversized subtracted objects might remove parts of your addition that they shouldn't.
>
CF
Carsten Fuchs
Fri, Feb 4, 2022 12:53 PM
Am 04.02.22 um 13:31 schrieb Raymond West:
However, it is quite interesting. Maybe a more complicated example would help me understand what I may be missing.
Please consider this example that I posted elsewhere in this thread:
module case() {
difference() {
cube(30);
// Make the box empty.
translate([2, 2, 4.1])
cube(26);
}
}
module panel() {
cube([100, 100, 2], center=true);
}
union() {
#panel();
// Module `case()` created an empty box, but when sunk into the panel
// the panel is also inside the box.
// Thus, desired is a method that subtracts the cutting `cube(26)` also
// in the scope of this union (but not necessarily further up!).
rotate([10, -12, 0])
translate([0, 0, -20])
case();
}
Even though a trivial example, it seems to be very complicated to clear the inside of the box.
Best regards,
Carsten
Am 04.02.22 um 13:31 schrieb Raymond West:
> However, it is quite interesting. Maybe a more complicated example would help me understand what I may be missing.
Please consider this example that I posted elsewhere in this thread:
module case() {
difference() {
cube(30);
// Make the box empty.
translate([2, 2, 4.1])
cube(26);
}
}
module panel() {
cube([100, 100, 2], center=true);
}
union() {
#panel();
// Module `case()` created an empty box, but when sunk into the panel
// the panel is also inside the box.
// Thus, desired is a method that subtracts the cutting `cube(26)` also
// in the scope of this union (but not necessarily further up!).
rotate([10, -12, 0])
translate([0, 0, -20])
case();
}
Even though a trivial example, it seems to be very complicated to clear the inside of the box.
Best regards,
Carsten
NH
nop head
Fri, Feb 4, 2022 3:51 PM
For that example you could subtract the hull of the box from the panel
before unioning but you might get errors due the the lack of an overlap
then.
If the upstream box needs to have the internals marked, then why not just
make the inside a module as well as the complete box? Then you can union
the box with the panel and subtract the inside again.
On Fri, 4 Feb 2022 at 12:53, Carsten Fuchs carsten.fuchs@cafu.de wrote:
Am 04.02.22 um 13:31 schrieb Raymond West:
However, it is quite interesting. Maybe a more complicated example would
help me understand what I may be missing.
Please consider this example that I posted elsewhere in this thread:
module case() {
difference() {
cube(30);
// Make the box empty.
translate([2, 2, 4.1])
cube(26);
}
}
module panel() {
cube([100, 100, 2], center=true);
}
union() {
#panel();
// Module `case()` created an empty box, but when sunk into the panel
// the panel is also inside the box.
// Thus, desired is a method that subtracts the cutting `cube(26)` also
// in the scope of this union (but not necessarily further up!).
rotate([10, -12, 0])
translate([0, 0, -20])
case();
}
Even though a trivial example, it seems to be very complicated to clear
the inside of the box.
Best regards,
Carsten
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
For that example you could subtract the hull of the box from the panel
before unioning but you might get errors due the the lack of an overlap
then.
If the upstream box needs to have the internals marked, then why not just
make the inside a module as well as the complete box? Then you can union
the box with the panel and subtract the inside again.
On Fri, 4 Feb 2022 at 12:53, Carsten Fuchs <carsten.fuchs@cafu.de> wrote:
> Am 04.02.22 um 13:31 schrieb Raymond West:
> > However, it is quite interesting. Maybe a more complicated example would
> help me understand what I may be missing.
>
>
> Please consider this example that I posted elsewhere in this thread:
>
>
>
> module case() {
> difference() {
> cube(30);
>
> // Make the box empty.
> translate([2, 2, 4.1])
> cube(26);
> }
> }
>
> module panel() {
> cube([100, 100, 2], center=true);
> }
>
>
> union() {
> #panel();
>
> // Module `case()` created an empty box, but when sunk into the panel
> // the panel is also inside the box.
> // Thus, desired is a method that subtracts the cutting `cube(26)` also
> // in the scope of this union (but not necessarily further up!).
> rotate([10, -12, 0])
> translate([0, 0, -20])
> case();
> }
>
>
>
> Even though a trivial example, it seems to be very complicated to clear
> the inside of the box.
>
> Best regards,
> Carsten
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
AM
Adrian Mariano
Fri, Feb 4, 2022 9:28 PM
Here's a way to do it in BOSL2 that is more encapsulated, where there
is no need to know the internals of the case() module to supply a
magical tag.
include<BOSL2-fork/std.scad>
// This module should be called
// in a diff(), tagged to be subtracted
module case() {
// On outer cube, remove the subtraction tag applied by caller
tags("")
cube(30);
// On inner cube, leave inherited tag alone
translate([2, 2, 4.1])
cube(26);
}
union() {
diff("remove")
cuboid([100,100,2]){
rotate([10,-12,0])
translate([0,0,-20])
case($tags="remove");
rotate([-10,-12,0])
translate([0,-45,-20])
case($tags="remove");
}
}
On Fri, Feb 4, 2022 at 3:25 AM Victor Buciuc victor.buciuc@gmail.com wrote:
Changed the code to work with BOSL2 and seems to work:
include <BOSL2/std.scad>;
module case() {
cuboid(30)
position(TOP)
up(0.01)
cuboid(26, $tags="hole", anchor=TOP);
}
module panel() {
cuboid([100, 100, 2]) {
children();
}
}
union() {
diff("hole")
panel()
attach(CENTER, BOTTOM)
// Module case() created an empty box, but when sunk into the panel
// the panel is also inside the box.
// Thus, desired is a method that subtracts the cutting cube(26) also
// in the scope of this union (but not necessarily further up!).
rotate([10, -12, 0])
translate([0, 0, -20])
case();
}
non-BOSL objects can be tagged with the tags() module: https://github.com/revarbat/BOSL2/wiki/attachments.scad#module-tags.
Problem with the example above is that case doesn't look like it was supposed to, you can apply the diff operation only once on a certain tag as far as I can figure it out.
Victor Buciuc
On Fri, Feb 4, 2022 at 10:02 AM Carsten Fuchs carsten.fuchs@cafu.de wrote:
Am 03.02.22 um 22:53 schrieb Adrian Mariano:
https://github.com/revarbat/BOSL2/wiki/Tutorial-Attachments#tagged-operations
Thanks for the link! It looks very interesting, but also complicated, and I'm not sure if it works with modules made outside of BOSL2, i.e. ones that don't come with attachments?
Best regards,
Carsten
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Here's a way to do it in BOSL2 that is more encapsulated, where there
is no need to know the internals of the case() module to supply a
magical tag.
include<BOSL2-fork/std.scad>
// This module should be called
// in a diff(), tagged to be subtracted
module case() {
// On outer cube, remove the subtraction tag applied by caller
tags("")
cube(30);
// On inner cube, leave inherited tag alone
translate([2, 2, 4.1])
cube(26);
}
union() {
diff("remove")
cuboid([100,100,2]){
rotate([10,-12,0])
translate([0,0,-20])
case($tags="remove");
rotate([-10,-12,0])
translate([0,-45,-20])
case($tags="remove");
}
}
On Fri, Feb 4, 2022 at 3:25 AM Victor Buciuc <victor.buciuc@gmail.com> wrote:
>
> Changed the code to work with BOSL2 and seems to work:
>
> include <BOSL2/std.scad>;
>
>
>
> module case() {
> cuboid(30)
> position(TOP)
> up(0.01)
> cuboid(26, $tags="hole", anchor=TOP);
>
> }
>
> module panel() {
> cuboid([100, 100, 2]) {
> children();
> }
> }
>
>
> union() {
> diff("hole")
> panel()
> attach(CENTER, BOTTOM)
> // Module `case()` created an empty box, but when sunk into the panel
> // the panel is also inside the box.
> // Thus, desired is a method that subtracts the cutting `cube(26)` also
> // in the scope of this union (but not necessarily further up!).
>
> rotate([10, -12, 0])
> translate([0, 0, -20])
> case();
> }
>
> non-BOSL objects can be tagged with the tags() module: https://github.com/revarbat/BOSL2/wiki/attachments.scad#module-tags.
>
> Problem with the example above is that case doesn't look like it was supposed to, you can apply the diff operation only once on a certain tag as far as I can figure it out.
>
> Victor Buciuc
>
>
> On Fri, Feb 4, 2022 at 10:02 AM Carsten Fuchs <carsten.fuchs@cafu.de> wrote:
>>
>> Am 03.02.22 um 22:53 schrieb Adrian Mariano:
>> > https://github.com/revarbat/BOSL2/wiki/Tutorial-Attachments#tagged-operations
>>
>> Thanks for the link! It looks very interesting, but also complicated, and I'm not sure if it works with modules made outside of BOSL2, i.e. ones that don't come with attachments?
>>
>> Best regards,
>> Carsten
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
JB
Jordan Brown
Sat, Feb 5, 2022 2:11 AM
I think that the most obvious application for "negative objects" is in
intersecting pipes.
module pipe(length, od, id) {
difference() {
cylinder(h=length, d=od, center=true);
cylinder(h=length+2, d=id, center=true);
}
}
pipe(length=5, od=2, id=1.9);
rotate([90,0,0]) pipe(length=5, od=2, id=1.9);
You might think this would work, but of course it doesn't because the
hole isn't part of the definition of the pipe, and so pipe A's walls
block pipe B, and vice versa. If the holes were "negative objects",
then pipe A's hole would cut both pipe A and pipe B, and pipe B's hole
would cut both B and A.
But now I want to put a plug into one of the pipes, and the hole cuts
through the plug.
I think that the most obvious application for "negative objects" is in
intersecting pipes.
module pipe(length, od, id) {
difference() {
cylinder(h=length, d=od, center=true);
cylinder(h=length+2, d=id, center=true);
}
}
pipe(length=5, od=2, id=1.9);
rotate([90,0,0]) pipe(length=5, od=2, id=1.9);
You might think this would work, but of course it doesn't because the
hole isn't part of the definition of the pipe, and so pipe A's walls
block pipe B, and vice versa. If the holes were "negative objects",
then pipe A's hole would cut both pipe A and pipe B, and pipe B's hole
would cut both B and A.
But now I want to put a plug into one of the pipes, and the hole cuts
through the plug.
AM
Adrian Mariano
Sat, Feb 5, 2022 2:52 AM
That's a nice application. I had to give it a quick try. So here's
two crosses with a plug:
include<BOSL2-fork/std.scad>
$fn=16;
module pipe(length, od, id) {
tags("") cylinder(h=length, d=od, center=true);
cylinder(h=length+2, d=id, center=true);
children();
}
module plug(length,od) {
cylinder(h=length, d=od,center=true);
}
diff("rem",keep="keep")
pipe(length=5, od=2, id=1.9,$tags="rem")
rotate([90,0,0])
pipe(length=5, od=2, id=1.9,$tags="rem")
up(5/2) plug(1,od=2.2,$tags="keep");
And the result is below. I'm not sure if this is practical or not for
a full pipe network. I think you'd have to build your pipes in a tree
structure, where pipe segments were children of other pipe segments
throughout the whole network. Maybe that would work? Hmmm.
ACtually I don't think you do have to do that. It think you can just
give diff() a block of stuff in braces and tag everything
appropriately. On the other hand, building pipe by connecting pieces
to other pipe is pretty natural.
On Fri, Feb 4, 2022 at 9:11 PM Jordan Brown
openscad@jordan.maileater.net wrote:
I think that the most obvious application for "negative objects" is in intersecting pipes.
module pipe(length, od, id) {
difference() {
cylinder(h=length, d=od, center=true);
cylinder(h=length+2, d=id, center=true);
}
}
pipe(length=5, od=2, id=1.9);
rotate([90,0,0]) pipe(length=5, od=2, id=1.9);
You might think this would work, but of course it doesn't because the hole isn't part of the definition of the pipe, and so pipe A's walls block pipe B, and vice versa. If the holes were "negative objects", then pipe A's hole would cut both pipe A and pipe B, and pipe B's hole would cut both B and A.
But now I want to put a plug into one of the pipes, and the hole cuts through the plug.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
That's a nice application. I had to give it a quick try. So here's
two crosses with a plug:
include<BOSL2-fork/std.scad>
$fn=16;
module pipe(length, od, id) {
tags("") cylinder(h=length, d=od, center=true);
cylinder(h=length+2, d=id, center=true);
children();
}
module plug(length,od) {
cylinder(h=length, d=od,center=true);
}
diff("rem",keep="keep")
pipe(length=5, od=2, id=1.9,$tags="rem")
rotate([90,0,0])
pipe(length=5, od=2, id=1.9,$tags="rem")
up(5/2) plug(1,od=2.2,$tags="keep");
And the result is below. I'm not sure if this is practical or not for
a full pipe network. I think you'd have to build your pipes in a tree
structure, where pipe segments were children of other pipe segments
throughout the whole network. Maybe that would work? Hmmm.
ACtually I don't think you do have to do that. It think you can just
give diff() a block of stuff in braces and tag everything
appropriately. On the other hand, building pipe by connecting pieces
to other pipe is pretty natural.
On Fri, Feb 4, 2022 at 9:11 PM Jordan Brown
<openscad@jordan.maileater.net> wrote:
>
> I think that the most obvious application for "negative objects" is in intersecting pipes.
>
> module pipe(length, od, id) {
> difference() {
> cylinder(h=length, d=od, center=true);
> cylinder(h=length+2, d=id, center=true);
> }
> }
>
> pipe(length=5, od=2, id=1.9);
> rotate([90,0,0]) pipe(length=5, od=2, id=1.9);
>
> You might think this would work, but of course it doesn't because the hole isn't part of the definition of the pipe, and so pipe A's walls block pipe B, and vice versa. If the holes were "negative objects", then pipe A's hole would cut both pipe A and pipe B, and pipe B's hole would cut both B and A.
>
> But now I want to put a plug into one of the pipes, and the hole cuts through the plug.
>
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
M
MichaelAtOz
Sat, Feb 5, 2022 7:44 AM
But that is not how you make real pipe joins.
Think of CSG, union as welding and difference as cutting or drilling, and intersection as [?]. Polyhedron as casting maybe.
To get a + shaped pipe structure you either
Possibly others.
We have to remember OpenSCAD is fundamentally a CSG machine.
However in my meanderings I found this discussion
https://github.com/SolidCode/SolidPython/issues/11
From: Jordan Brown [mailto:openscad@jordan.maileater.net]
Sent: Sat, 5 Feb 2022 13:11
To: OpenSCAD general discussion; Torsten Paul
Subject: [OpenSCAD] Re: Subtraction from parents?
I think that the most obvious application for "negative objects" is in intersecting pipes.
module pipe(length, od, id) {
difference() {
cylinder(h=length, d=od, center=true);
cylinder(h=length+2, d=id, center=true);
}
}
pipe(length=5, od=2, id=1.9);
rotate([90,0,0]) pipe(length=5, od=2, id=1.9);
You might think this would work, but of course it doesn't because the hole isn't part of the definition of the pipe, and so pipe A's walls block pipe B, and vice versa. If the holes were "negative objects", then pipe A's hole would cut both pipe A and pipe B, and pipe B's hole would cut both B and A.
But now I want to put a plug into one of the pipes, and the hole cuts through the plug.
--
This email has been checked for viruses by AVG.
https://www.avg.com
But that is not how you make real pipe joins.
Think of CSG, union as welding and difference as cutting or drilling, and intersection as [?]. Polyhedron as casting maybe.
To get a + shaped pipe structure you either
- cast it as one + piece
- cut curved ends on four pieces and weld them together
- cut curved ends on two pieces and weld them on a third then drill out the centre
Possibly others.
We have to remember OpenSCAD is fundamentally a CSG machine.
However in my meanderings I found this discussion
https://github.com/SolidCode/SolidPython/issues/11
_____
From: Jordan Brown [mailto:openscad@jordan.maileater.net]
Sent: Sat, 5 Feb 2022 13:11
To: OpenSCAD general discussion; Torsten Paul
Subject: [OpenSCAD] Re: Subtraction from parents?
I think that the most obvious application for "negative objects" is in intersecting pipes.
module pipe(length, od, id) {
difference() {
cylinder(h=length, d=od, center=true);
cylinder(h=length+2, d=id, center=true);
}
}
pipe(length=5, od=2, id=1.9);
rotate([90,0,0]) pipe(length=5, od=2, id=1.9);
You might think this would work, but of course it doesn't because the hole isn't part of the definition of the pipe, and so pipe A's walls block pipe B, and vice versa. If the holes were "negative objects", then pipe A's hole would cut both pipe A and pipe B, and pipe B's hole would cut both B and A.
But now I want to put a plug into one of the pipes, and the hole cuts through the plug.
--
This email has been checked for viruses by AVG.
https://www.avg.com