|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I'm working on my first 'real' POV-Ray project, a complicated (IMO) model
of NASA's Cassini spacecraft. This has made me wonder how people usually
create really complicated stuff in POV. I'm a programmer myself but
*lots* of people using POV are not. The point is that while making this
model I have found it almost impossible to construct certain parts of it
without using lots of small 'command line' utilities I wrote in C++ to do
some geometric calculations, for instance:
(1) Given two circles, find the four lines that are tangential two both
circles and the points where they 'touch' the circles.
(2) Given two lines through three points (you can think of this as two
out of three sides on a triangle), determine the center and radius of a
circle which 'touches' one of the lines at a point with a known distance
from the point common to the two lines.
And so on, I have written about 5-7 such utilities in recent weeks. I
use the results from them primarily in POV's union and difference
statements. Non-programmers can't create utilities like this (and
calculating something like this on e.g. a pocket calculator is extremely
tedious) so I'm wondering if I'm missing something, are utilities like
this available somewhere (if that is the case then *that's* what I've
missed ;-), are you using such utilities or is what I'm doing unusual in
some way (I don't think so) ?
I'm coding the model 'by hand' in POV (the POV file is now more than
2000 lines) but I'm using lots of 'blueprints' and information on Cassini
that I have found at several (mainly NASA/JPL) websites.
Renderings of my Cassini model can be seen at:
http://www.mmedia.is/~bjj/povstuff/cassini
The radar antennae were particularly complicated and required heavy use
of my utilities.
Bjorn Jonsson
bjj### [at] zzzmmediais - http://www.mmedia.is/~bjj
Remove yyy and zzz to reply
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Mon, 27 Mar 2000 22:46:28 -0000, bjj### [at] zzzmmediais (Bjorn
Jonsson) wrote:
<snip>
>And so on, I have written about 5-7 such utilities in recent weeks. I
>use the results from them primarily in POV's union and difference
>statements. Non-programmers can't create utilities like this (and
>calculating something like this on e.g. a pocket calculator is extremely
>tedious) so I'm wondering if I'm missing something, are utilities like
>this available somewhere (if that is the case then *that's* what I've
>missed ;-), are you using such utilities or is what I'm doing unusual in
>some way (I don't think so) ?
If you could turn those (really useful!) utilities into povray macros,
I am sure many people will be thankful for making their lives a tad
easier. About your question, I would usually use a macro for such
tasks because it spares some trouble with switching consoles, copying
& pasting etc.
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG e-mail : pet### [at] tagpovrayorg
Post a reply to this message
|
|
| |
| |
|
|
From: Bill DeWitt
Subject: Re: Modeling complicated objects in POV-Ray
Date: 27 Mar 2000 19:02:08
Message: <38dff680@news.povray.org>
|
|
|
| |
| |
|
|
"Bjorn Jonsson" <bjj### [at] zzzmmediais> wrote :
>
> (1) Given two circles, find the four lines that are tangential two both
> circles and the points where they 'touch' the circles.
>
> (2) Given two lines through three points (you can think of this as two
> out of three sides on a triangle), determine the center and radius of a
> circle which 'touches' one of the lines at a point with a known distance
> from the point common to the two lines.
>
When I need to do things like this I open AutoCad and work it out then
use the numbers generated to type it into PovRay. There have been a few
times when I needed to work out the formula, but that usually takes me weeks
of head-banging effort so I am very willing to cheat.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Bjorn Jonsson <bjj### [at] zzzmmediais> wrote:
: (1) Given two circles, find the four lines that are tangential two both
: circles and the points where they 'touch' the circles.
: (2) Given two lines through three points (you can think of this as two
: out of three sides on a triangle), determine the center and radius of a
: circle which 'touches' one of the lines at a point with a known distance
: from the point common to the two lines.
Both of those are perfectly possible with povray itself.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I have earlier had some of the same problems as you but I
solved them (as Peter Popov suggested) with POV-macros.
(Macros were added to POV-Ray in v3.1)
One of my "problems" with building my own macro collection
is how to make a set of "useful macros" that are what some
might call "orthogonal".
I struggle with the choice between collecting all the necessary
computations for a specific problem in one macro for parsing
speed, (and maybe clarity) and breaking the specific problem
into many smaller ones which are solved in their own little
macros for reuse of code.
As an example I have included below some macros that
solve your second problem (In 3D-space though).
(If you are interested I can post a sample file which shows
how to use them.)
I could have solved the problem with only one macro, but
I find the smaller macros so useful that I choose to keep
them as separate macros (at the cost of parsing speed, I think).
Tor Olav
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html
Bjorn Jonsson wrote:
> (2) Given two lines through three points (you can think of this as two
> out of three sides on a triangle), determine the center and radius of a
> circle which 'touches' one of the lines at a point with a known distance
> from the point common to the two lines.
#macro vproject(uu, vv)
(vv*vdot(uu, vv)/vdot(vv, vv))
#end // macro vproject
#macro Find_Scalar(uu, vv, dd)
(dd/vlength(vproject(uu, vv) -uu))
#end // macro Find_Scalar
#macro Find_Radius(FirstPt, MidPt, LastPt, Radius, StartPt, CenterPt, EndPt,
Vup)
#local Vector1 = vnormalize(FirstPt - MidPt);
#local Vector2 = vnormalize(LastPt - MidPt);
#local MidVector = vnormalize(Vector1 + Vector2);
#local MidVector = MidVector*Find_Scalar(Vector1, MidVector, Radius);
#declare CenterPt = MidPt + MidVector;
#declare StartPt = MidPt + vproject(MidVector, Vector1);
#declare EndPt = MidPt + vproject(MidVector, Vector2);
#declare Vup = vcross(Vector1, Vector2);
#end // macro Find_Radius
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Tor Olav Kristensen wrote:
> As an example I have included below some macros that
> solve your second problem (In 3D-space though).
Oops, I didn't read this thoroughly:
> Bjorn Jonsson wrote:
>
> > (2) Given two lines through three points (you can think of this as two
> > out of three sides on a triangle), determine the center and radius of a
> > circle which 'touches' one of the lines at a point with a known distance
> > from the point common to the two lines.
The macros I posted finds the centre of a circle with a GIVEN radius,
and that touches BOTH of your lines. The "touch-points" are also
returned together with the normal-vector for the plane that the two
lines lies in. (The centre of the circle lies in this plane.)
Tor Olav
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html
Post a reply to this message
|
|
| |
| |
|
|
From: Ron Parker
Subject: Re: Modeling complicated objects in POV-Ray
Date: 28 Mar 2000 11:47:26
Message: <38e0e21e@news.povray.org>
|
|
|
| |
| |
|
|
On Mon, 27 Mar 2000 22:46:28 -0000, Bjorn Jonsson wrote:
>(2) Given two lines through three points (you can think of this as two
>out of three sides on a triangle), determine the center and radius of a
>circle which 'touches' one of the lines at a point with a known distance
>from the point common to the two lines.
As written, there are an infinite number of solutions to this problem;
one is the circle with its center at the point common to the two lines
and with a radius of the 'known distance.'
Even if you specify that 'touches' means 'is tangent to,' there are an
infinite number of solutions. Do you mean one that is tangent to both
lines?
--
These are my opinions. I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <38e0e21e@news.povray.org>, ron### [at] povrayorg says...
> On Mon, 27 Mar 2000 22:46:28 -0000, Bjorn Jonsson wrote:
> >(2) Given two lines through three points (you can think of this as two
> >out of three sides on a triangle), determine the center and radius of a
> >circle which 'touches' one of the lines at a point with a known distance
> >from the point common to the two lines.
>
> As written, there are an infinite number of solutions to this problem;
> one is the circle with its center at the point common to the two lines
> and with a radius of the 'known distance.'
>
> Even if you specify that 'touches' means 'is tangent to,' there are an
> infinite number of solutions. Do you mean one that is tangent to both
> lines?
Oops... yes, there is an error in what I wrote above. I meant that the
circle is tangential to *both* lines, not just one of them.
Thanks for correcting this rather silly error.
Bjorn
Post a reply to this message
|
|
| |
| |
|
|
From: Ron Parker
Subject: Re: Modeling complicated objects in POV-Ray
Date: 28 Mar 2000 13:31:01
Message: <38e0fa65@news.povray.org>
|
|
|
| |
| |
|
|
On Mon, 27 Mar 2000 22:46:28 -0000, Bjorn Jonsson wrote:
>And so on, I have written about 5-7 such utilities in recent weeks. I
>use the results from them primarily in POV's union and difference
>statements. Non-programmers can't create utilities like this (and
>calculating something like this on e.g. a pocket calculator is extremely
>tedious) so I'm wondering if I'm missing something, are utilities like
>this available somewhere (if that is the case then *that's* what I've
>missed ;-), are you using such utilities or is what I'm doing unusual in
>some way (I don't think so) ?
Some utilities like this are available. John VanSickle has a few in his
Thoroughly Useful Macros collection, there are others scattered throughout
the newsgroups here, and there are others on various web pages around the
net. There used to be a site, #MacroScope, that was a collection of such
macros, but it is now defunct. The macros from that site, and many more,
can be found at
http://www.povray.org/links/POV-Ray_Include_Macro_and_Object_Files/Macro_Files/
My torus spline macro isn't linked from there, but I'm sure that's an oversight.
It's included in the #MacroScope file anyway, or available from the "other
stuff" link below.
--
These are my opinions. I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Ron Parker wrote:
> My torus spline macro isn't linked from there,
It is linked from -
http://www.povray.org/links/POV-Ray_Include_Macro_and_Object_Files/Object_and_Scene_Files/
--
Ken Tyler - 1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|