Can anyone help me to render my model.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Can anyone help me to render my model.

Jaacov Molcho
This is the code I cannot  render:

//         Astroid Pendant
//        =================
a=20;
b=a*360/PI;
$fn=6;
function x(t)= a*cos(t)*cos(t)*cos(t);
function y(t)= a*sin(t)*sin(t)*sin(t);
module graph(r, step) {
   for (t=[-b:step:b]) {
      translate([x(t),y(t),0])
       render()  
       rotate([0,90,-90])  
       //cylinder(2,2,2,true);
       sphere(1.5);
   } };

graph(3,4);

render()
translate([0,22.5,0])
rotate([0,90,0])
rotate_extrude(convexity = 10)
translate([2, 0, 0])
circle(.5);

//x(t) = r cos(t)^3,
//y(t) = r sin(t)^3,
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can anyone help me to render my model.

kitwallace
Jaacov, I've taken the liberty of moding your code a bit:

using hull to join adjacent pairs of spheres
reducing the number of spheres created - only 1 revolution needed
adding a parameter to the graph module to separately control the number of sides of the astroid

With the given parameters, it renders in a couple of minutes for me

Regards

Chris

//         Astroid Pendant

//        =================
a=20;  
function x(t)= a*cos(t)*cos(t)*cos(t);
function y(t)= a*sin(t)*sin(t)*sin(t);

module graph(r, step, sides, max=360) {
   for (t=[0:step:max]) {
       hull() {
           translate([x(t),y(t),0])   sphere(r,$fn=sides);
           translate([x(t+step),y(t+step),0])   sphere(r,$fn=sides);
           
       }
   }
};

graph(1,4,12);

$fn=6;
render()
translate([0,22.5,0])
rotate([0,90,0])
rotate_extrude(convexity = 10)
translate([2, 0, 0])
circle(.5);

//x(t) = r cos(t)^3,
//y(t) = r sin(t)^3,
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can anyone help me to render my model.

Jaacov Molcho
Thank you very much.
I liked your approach.
It also gave a smoother finish to the model.

I am using OpenScad to create 3D printed models.
You are invited to visit my shop at:
This are some more links to my advertising: 
https://www.youtube.com/watch?v=1lbw6H9tzbk
https://twitter.com/ymolcho
https://www.instagram.com/ymolcho12/
Jaacov Molcho
 



From: kitwallace [via OpenSCAD] <[hidden email]>
To: Jaacov Molcho <[hidden email]>
Sent: Monday, April 17, 2017 7:07 PM
Subject: Re: Can anyone help me to render my model.

Jaacov, I've taken the liberty of moding your code a bit:

using hull to join adjacent pairs of spheres
reducing the number of spheres created - only 1 revolution needed
adding a parameter to the graph module to separately control the number of sides of the astroid

With the given parameters, it renders in a couple of minutes for me

Regards

Chris

//         Astroid Pendant

//        =================
a=20;  
function x(t)= a*cos(t)*cos(t)*cos(t);
function y(t)= a*sin(t)*sin(t)*sin(t);

module graph(r, step, sides, max=360) {
   for (t=[0:step:max]) {
       hull() {
           translate([x(t),y(t),0])   sphere(r,$fn=sides);
           translate([x(t+step),y(t+step),0])   sphere(r,$fn=sides);
           
       }
   }
};

graph(1,4,12);

$fn=6;
render()
translate([0,22.5,0])
rotate([0,90,0])
rotate_extrude(convexity = 10)
translate([2, 0, 0])
circle(.5);

//x(t) = r cos(t)^3,
//y(t) = r sin(t)^3,



If you reply to this email, your message will be added to the discussion below:
http://forum.openscad.org/Can-anyone-help-me-to-render-my-model-tp21266p21267.html
To unsubscribe from Can anyone help me to render my model., click here.
NAML


Loading...