[OpenSCAD] What's the best way to accomplish splitting these elements?

MichaelAtOz oz.at.michael at gmail.com
Fri Jul 5 19:48:31 EDT 2019


guaranteed_interwoven wrote
> (In addition, what is the name of the operation I am trying to accomplish
> here?)

I don't think it has a name. Disaggregate?


guaranteed_interwoven wrote
> My thought is perhaps create 2d profile shapes from the intersection of
> the
> cones, projected to an xy plane at z = 0. Then extrude those above the
> cone
> max heights. Finally, one by one, do intersections of those extruded
> projections with each cone. I'm not exactly sure how to do this though.

That sounds about right, except you want to mix 
a. difference() the extruded-projection from the outside cone(s).
b. intersection() the inner cone(s).

a.
<http://forum.openscad.org/file/t359/Capture_cone_diff_a.jpg> 

Simple code:

module c1()   translate([4, 5, 0])
              cylinder(d1=10, d2=0, h=10);
module c2()   cylinder(d1=10, d2=0, h=10);
module c3()   translate([-5, 3, 0])
              cylinder(d1=15, d2=0, h=10);

difference() {
  c3();
  linear_extrude(height=11)
  projection() {
    union() {  
      intersection() {
        c3();
        c1();
      }
    c1();
    }
  }
}  

Make it more generic:

module c1()   translate([4, 5, 0])
              cylinder(d1=10, d2=0, h=10);
module c2()   cylinder(d1=10, d2=0, h=10);
module c3()   translate([-5, 3, 0])
              cylinder(d1=15, d2=0, h=10);

module diff_extr_proj() {
  difference() {
    children(0);
    linear_extrude(height=11)
    projection() {
      union() {  
        intersection() {
          children(0);
          children(1);
        }
      children(1);
      }
    }
  }  
}

diff_extr_proj() {
  c3();
  c1();
}

For b. just rearrange the above. 







-----
Admin - email* me if you need anything, or if I've done something stupid...

* click on my MichaelAtOz label, there is a link to email me.

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. Obviously 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/   time is running out!
--
Sent from: http://forum.openscad.org/



More information about the Discuss mailing list