discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Trying To Create Agave Plant

B
brenzo
Fri, Dec 21, 2018 5:57 AM

I'm stuck on this. I'm trying to make an agave plant,  similar to this.
https://images-na.ssl-images-amazon.com/images/I/71z8slvNMrL._SX425_.jpg

I want to create 1 leaf, and then I can rotate and copy it as I please. I
can break all the values into variables and size the leaves appropriately
during the loop iterations.

You can tell it is essentially an elongated kite shape, it tapers wider from
the base then tapers back to a point.

This is what I have so far:

union() {
linear_extrude(height = 50, center=false, scale = 1.3) {
difference() {
circle(5);
translate([3, 3, 0])
circle(8);
}
}

//rotate([3, -3, 0])
translate([0, 0, 50])
linear_extrude(height = 10, center=false, scale = 0) {
difference() {
circle(6.5);
translate([3, 3, 0])
circle(9.1);
}
}
}

Issue being the scale here causes the extrusion to "tip" one way or the
other. This is acceptable enough for me for the bottom section but for the
top section it leans toward the Z-axis and looks awkward. I've tried tipping
the cross section back but I have to keep changing parameters and it feels
awkward and hacky.

--
Sent from: http://forum.openscad.org/

I'm stuck on this. I'm trying to make an agave plant, similar to this. <https://images-na.ssl-images-amazon.com/images/I/71z8slvNMrL._SX425_.jpg> I want to create 1 leaf, and then I can rotate and copy it as I please. I can break all the values into variables and size the leaves appropriately during the loop iterations. You can tell it is essentially an elongated kite shape, it tapers wider from the base then tapers back to a point. This is what I have so far: union() { linear_extrude(height = 50, center=false, scale = 1.3) { difference() { circle(5); translate([3, 3, 0]) circle(8); } } //rotate([3, -3, 0]) translate([0, 0, 50]) linear_extrude(height = 10, center=false, scale = 0) { difference() { circle(6.5); translate([3, 3, 0]) circle(9.1); } } } Issue being the scale here causes the extrusion to "tip" one way or the other. This is acceptable enough for me for the bottom section but for the top section it leans toward the Z-axis and looks awkward. I've tried tipping the cross section back but I have to keep changing parameters and it feels awkward and hacky. -- Sent from: http://forum.openscad.org/
RP
Ronaldo Persiano
Fri, Dec 21, 2018 12:26 PM

Have you checked center=true?

Have you checked center=true?
RP
Ronaldo Persiano
Fri, Dec 21, 2018 12:31 PM

Sorry, I meant to center the base shape.

Na(o) sexta, 21/12/2018, 12:26, Ronaldo Persiano rcmpersiano@gmail.com
escreveu:

Have you checked center=true?

Sorry, I meant to center the base shape. Na(o) sexta, 21/12/2018, 12:26, Ronaldo Persiano <rcmpersiano@gmail.com> escreveu: > Have you checked center=true? >
RP
Ronaldo Persiano
Fri, Dec 21, 2018 1:04 PM

Now, I have checked it on my computer. That is what I got:

module base()
translate([3,3,0])
difference() {
circle(5);
translate([3, 3, 0])
circle(8);
}

union() {
linear_extrude(height = 50, scale = 1.3) base();
translate([0, 0, 50])
linear_extrude(height = 10, scale = 0)
scale(1.3) base();
}

Now, I have checked it on my computer. That is what I got: module base() translate([3,3,0]) difference() { circle(5); translate([3, 3, 0]) circle(8); } union() { linear_extrude(height = 50, scale = 1.3) base(); translate([0, 0, 50]) linear_extrude(height = 10, scale = 0) scale(1.3) base(); }
AR
Algot Runeman
Fri, Dec 21, 2018 8:34 PM

On 12/21/18 8:04 AM, Ronaldo Persiano wrote:

Now, I have checked it on my computer. That is what I got:

 module base()
 translate([3,3,0])
 difference() {
   circle(5);
   translate([3, 3, 0])
     circle(8);
 }
 union() {
 linear_extrude(height = 50, scale = 1.3) base();
 translate([0, 0, 50])
 linear_extrude(height = 10, scale = 0)
   scale(1.3) base();
 }

Brenzo, Ronaldo,

I've been trying to get to grips on making rotations work like the
section of the manual where aim and azimuth are described. Those
examples use simpler shapes than the agave leaf you have proposed.

I hope this example helps you develop what you plan.

--Algot

// Agave Attempt
// built based on code from
// brenzo brennanruthardt@gmail.com
// Ronaldo Persiano rcmpersiano@gmail.com
// in the OpenSCAD mailing list 2018-12-21
// http://forum.openscad.org/

// modules for aim and rotary cluster come from the online manual in the
section on modules
//
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#Modules

module aim(elevation,azimuth=0)
    { rotate([0,0,azimuth])
      { rotate([0,90-elevation,0]) children(0);
      children([1:1:$children-1]);   // step needed in case $children < 2
} }

module RotaryCluster(radius=30,number=8)
    for (azimuth =[0:360/number:359])
      rotate([0,0,azimuth])
        translate([radius,0,0]) { children(); }

            module ba()  // base element of blade
      translate([3,3,0])
        difference() {
          circle(5);
          translate([3, 3, 0])
            circle(8);
        }
    module blade(){
    union() {
      linear_extrude(height = 50, scale = .7) ba();
      translate([0, 0, 50])
        linear_extrude(height = 10, scale = 0)
          scale(.7) ba();
    }
}
// Though I cannot explain the vertical rotation of 135 deg, it helps to
arrange the blades as they should be with the blade curve upward
RotaryCluster(0,6) color("green")
aim(80){rotate([0,0,135])scale(.5)blade();}
RotaryCluster(0,12) color("green")
aim(60){rotate([0,0,135])scale(.8)blade();}
RotaryCluster(0,12) color("lightgreen") aim(45){rotate([0,0,135])blade();}

On 12/21/18 8:04 AM, Ronaldo Persiano wrote: > Now, I have checked it on my computer. That is what I got: > > module base() > translate([3,3,0]) > difference() { >   circle(5); >   translate([3, 3, 0]) >     circle(8); > } > union() { > linear_extrude(height = 50, scale = 1.3) base(); > translate([0, 0, 50]) > linear_extrude(height = 10, scale = 0) >   scale(1.3) base(); > } > Brenzo, Ronaldo, I've been trying to get to grips on making rotations work like the section of the manual where aim and azimuth are described. Those examples use simpler shapes than the agave leaf you have proposed. I hope this example helps you develop what you plan. --Algot // Agave Attempt // built based on code from // brenzo <brennanruthardt@gmail.com> // Ronaldo Persiano <rcmpersiano@gmail.com> // in the OpenSCAD mailing list 2018-12-21 // http://forum.openscad.org/ // modules for aim and rotary cluster come from the online manual in the section on modules // https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#Modules module aim(elevation,azimuth=0)     { rotate([0,0,azimuth])       { rotate([0,90-elevation,0]) children(0);       children([1:1:$children-1]);   // step needed in case $children < 2 } } module RotaryCluster(radius=30,number=8)     for (azimuth =[0:360/number:359])       rotate([0,0,azimuth])         translate([radius,0,0]) { children(); }             module ba()  // base element of blade       translate([3,3,0])         difference() {           circle(5);           translate([3, 3, 0])             circle(8);         }     module blade(){     union() {       linear_extrude(height = 50, scale = .7) ba();       translate([0, 0, 50])         linear_extrude(height = 10, scale = 0)           scale(.7) ba();     } } // Though I cannot explain the vertical rotation of 135 deg, it helps to arrange the blades as they should be with the blade curve upward RotaryCluster(0,6) color("green") aim(80){rotate([0,0,135])scale(.5)blade();} RotaryCluster(0,12) color("green") aim(60){rotate([0,0,135])scale(.8)blade();} RotaryCluster(0,12) color("lightgreen") aim(45){rotate([0,0,135])blade();}
B
brenzo
Sun, Dec 23, 2018 1:31 AM

Thank you both this was extremely helpful. Ronaldo your method of centering
the leaf makes a lot of sense.

Algotruneman your example seems like a more elegant way to accomplish what
I'm trying. I'm brand new to openscad so I'll study the section you linked,
I appreciate the help!

--
Sent from: http://forum.openscad.org/

Thank you both this was extremely helpful. Ronaldo your method of centering the leaf makes a lot of sense. Algotruneman your example seems like a more elegant way to accomplish what I'm trying. I'm brand new to openscad so I'll study the section you linked, I appreciate the help! -- Sent from: http://forum.openscad.org/