Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use #declare and spline using vapory? #25

Open
jitAbhra opened this issue Apr 11, 2016 · 0 comments
Open

How to use #declare and spline using vapory? #25

jitAbhra opened this issue Apr 11, 2016 · 0 comments

Comments

@jitAbhra
Copy link

Dear Zulko,

This is a very nice and scalable wrapper to use povray. I wanted to use spline using vapory to create continuous curves. An example from povray is such.


declare MySpline =

spline {
cubic_spline
-.25, <0,0,-1>
0.00, <1,0,0>
0.25, <0,0,1>
0.50, <-1,0,0>
0.75, <0,0,-1>
1.00, <1,0,0>
1.25, <0,0,1>
}

declare ctr = 0;

while (ctr < 1)

sphere {
MySpline(ctr),.25
pigment { rgb <1-ctr,ctr,0> }
}
#declare ctr = ctr + 0.01;

end


If I break it up in multiple steps. It does two things

  1. interpolate data given set of points. (Problem is here)
  2. Then plotting spheres.

Two methods came to my mind to solve the problem. First, interpolate the data by using some spline with higher resolution using scipy. But it has the drawback of storing interpolated data points. Or, find a way to declare spline function in povray using vapory. Is it possible to do from vapory?

Would you please share your comments and possible suggestion to implement this using vapory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant