|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
How does one draw a parametric curve on a surface, for example the helyx:
f(t) - (cos t, sin t, t)
on the surface of a cone x^2 + y^2 = 1?
I can't seem to find anything about plotting cusrves on the manual.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Alfred Knudson" <nomail@nomail> wrote:
> How does one draw a parametric curve on a surface, for example the helyx:
>
> f(t) - (cos t, sin t, t)
>
> on the surface of a cone x^2 + y^2 = 1?
>
> I can't seem to find anything about plotting cusrves on the manual.
Hi Alfred
The code below might give you a hint of one way to achieve this.
--
Tor Olav
http://subcube.com
https://github.com/t-o-k
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
/*
Cylinders with spiral pigment
By Tor Olav Kristensen, 2024-09-29
https://www.povray.org/documentation/view/3.7.1/395/
https://www.povray.org/documentation/view/3.7.1/448/
*/
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
#version 3.7;
global_settings { assumed_gamma 1.0 }
#include "functions.inc"
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
#declare Tau = 2*pi;
#declare Cylinder_R = 1.0;
#declare Spiral_R = 0.08;
#declare NoOfHelixes = 1;
#declare NoOfTurns = 1.0; // Per y unit
#declare Shape = 1.0;
#declare CrossSectionType = 1.0; // Circle
#declare CrossSectionRotationAngle = 0.0;
#declare HelixFn =
function {
f_helix1(
x, y, z,
NoOfHelixes,
NoOfTurns*Tau,
Spiral_R,
Cylinder_R,
Shape,
CrossSectionType,
CrossSectionRotationAngle
)
}
#declare HelixIsosurface =
isosurface {
function { HelixFn(x, y, z) }
threshold 0.0
max_gradient 4.0
accuracy 0.0001
contained_by {
box {
-2*<1, 1, 1>,
+2*<1, 1, 1>
}
}
pigment { color rgb <1.0, 1.0, 1.0> }
}
#declare ColorMap =
color_map {
[ 0.5 color rgb <1.0, 0.0, 0.8> ]
[ 0.5 color rgb <0.0, 0.8, 1.0> ]
}
#declare CylinderIsosurface =
isosurface {
function { f_sphere(x, 0, z, Cylinder_R) }
threshold 0.0
max_gradient 4.0
accuracy 0.0001
contained_by {
box {
-2*<1, 1, 1>,
+2*<1, 1, 1>
}
}
pigment {
function { HelixFn(x, y, z) - 0.17 }
color_map { ColorMap }
}
}
#declare Cylinder =
cylinder {
-2*y, +2*y, Cylinder_R
pigment {
spiral1 1
color_map { ColorMap }
rotate +90*x
scale <1, 1, -1>
rotate +90*y
}
}
union {
object { CylinderIsosurface }
object { HelixIsosurface }
translate -1.8*x
}
union {
object { Cylinder }
object { HelixIsosurface }
translate +1.8*x
}
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
background { color rgb 0.2*<1, 1, 1> }
light_source {
100*<+1, +3, -1>
color rgb <1, 1, 1>
shadowless
}
camera {
orthographic
location < 0, +1, -2>*3
look_at <0, 0, 0>
}
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> "Alfred Knudson" <nomail@nomail> wrote:
> > How does one draw a parametric curve on a surface, for example the helyx:
> >
> > f(t) - (cos t, sin t, t)
> >
> > on the surface of a cone x^2 + y^2 = 1?
> >
> > I can't seem to find anything about plotting cusrves on the manual.
>
> Hi Alfred
>
> The code below might give you a hint of one way to achieve this.
>...
This may be a better example for you.
You can also replace the cylinder and the spiral objects with isosurfaces.
--
Tor Olav
http://subcube.com
https://github.com/t-o-k
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
/*
Cylinder with parametric spiral pigment
By Tor Olav Kristensen, 2024-09-29
*/
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
#version 3.7;
global_settings { assumed_gamma 1.0 }
#include "functions.inc"
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
#declare Tau = 2*pi;
#declare Radius = 1.5;
// Fn(s): <Radius*cos(s), Radius*sin(s), s>
#declare Helix_FnX = function(s) { Radius*cos(s) };
#declare Helix_FnY = function(s) { Radius*sin(s) };
#declare Helix_FnZ = function(s) { s };
#declare N = 1000;
#declare MinT = -2.5*Tau;
#declare MaxT = +2.5*Tau;
#declare dT = (MaxT - MinT)/N;
#declare R = 0.4;
#declare Spiral =
union {
#declare T_Previous = MinT;
#declare pPrevious =
<
Helix_FnX(T_Previous),
Helix_FnY(T_Previous),
Helix_FnZ(T_Previous)
>
;
sphere { pPrevious, R }
#for (I, 0, N - 1)
#declare T_Next = T_Previous + dT;
#declare pNext =
<
Helix_FnX(T_Next),
Helix_FnY(T_Next),
Helix_FnZ(T_Next)
>
;
cylinder { pPrevious, pNext, R }
sphere { pNext, R }
#declare T_Previous = T_Next;
#declare pPrevious = pNext;
#end // for
}
cylinder {
MinT*z, MaxT*z, Radius
pigment {
object {
Spiral
color rgb <0.0, 0.3, 1.0> // Outside
color rgb <1.0, 0.7, 0.0> // Inside
}
}
}
/*
object {
Spiral
pigment { color rgb <1.0, 1.0, 1.0> }
}
*/
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
background { color rgb 0.2*<1, 1, 1> }
light_source {
100*<+1, +3, -1>
color rgb <1, 1, 1>
shadowless
}
camera {
orthographic
location < 0, +3, -8>*2
look_at <0, 0, 0>
}
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
So, it is really true that there is no framework to "draw" on a surface? And one
has to mimic it with pigmentation, sequence of cylindes, ....
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Alfred Knudson" <nomail@nomail> wrote:
> So, it is really true that there is no framework to "draw" on a surface? And one
> has to mimic it with pigmentation, sequence of cylindes, ....
There are a few spline based shapes, spheresweep, sor and prism. But with these
you are bound to the spline options they provide.
An alternative is to loft along a spline or curve and thus create a mesh, then
you have full freedom. Look at meshmaker.inc in the distribution for some ideas.
curves.zip at https://ingoogni.nl/download/ has many curves and splines. One
could also loft one parametric along an other parametric, for example to create
a torus.
ingo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Alfred Knudson" <nomail@nomail> wrote:
> So, it is really true that there is no framework to "draw" on a surface? And one
> has to mimic it with pigmentation, sequence of cylindes, ....
Well, the thing is - POV-Ray is a raytracer, and nearly everything that it deals
with is a 3D object. There's no inherent way to "draw" infinitely thin 2D
lines.
Plus, there needs to be a way to determine where the surface is.
So, you can create some sort of visible 3D object such as a sphere-sweep, linked
cylinders and spheres, a parametric, and isosurface, etc to position a visible
object that follows the surface according to how you want to draw your line.
If you want the line to be flat and literally ON the surface, you could use the
object {} pattern, and color the surface on way where the line is, and another
way where the line is not.
https://wiki.povray.org/content/Reference:Object_Pattern
There are likely other somewhat functionally equivalent methods - but providing
a link as to exactly what you're looking to do would the most helpful in terms
of finding an answer.
- Bill
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|