POV-Ray : Newsgroups : povray.programming : Prisms, lathes, and code duplication Server Time
16 Apr 2024 10:41:35 EDT (-0400)
  Prisms, lathes, and code duplication (Message 1 to 1 of 1)  
From: Nicolas Alvarez
Subject: Prisms, lathes, and code duplication
Date: 2 Oct 2008 11:53:53
Message: <48e4ee91@news.povray.org>
As far as I can tell, there is quite a bit of duplicated maths in the
path-based POV-Ray shapes. I don't understand *any* of the maths used, so I
can't really tell if it's the same...

In particular, prisms and lathes seem to use quite similar code for testing
if a point lies inside the object (see in_curve in prism.cpp and
Inside_Lathe in lathe.cpp).

I wanted to try implementing a new feature which would involve testing if
points lie inside closed areas (which could be using straight lines,
quadratic curves and bezier curves all in the same path!), and I found it
strange that POV-Ray doesn't already have reusable functions to do the
maths for that.

Are the maths actually *that* different for intersecting paths in prism,
lathe, sor, and truetype fonts? Or could they possibly be combined into
reusable functions used by all (or most) shapes?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.