POV-Ray : Newsgroups : povray.general : MELT : Re: MELT Server Time
2 Jun 2024 05:21:07 EDT (-0400)
  Re: MELT  
From: scott
Date: 23 Dec 2015 04:43:25
Message: <567a6cbd$1@news.povray.org>
> Yes, exactly. Well recognized what I talk about. A hell to develop, I am
> sure, but hell needed, too.  :-)

Although there are some similarities between the way you build objects 
(CSG) in POV and CAD, the way it works internally is very different. The 
way POV does it is simply not suited to adding "rounds".

Take an example of subtracting a cylinder from a box, to get a box with 
a hole through the middle:

In CAD, the software will first create a boundary representation (brep) 
of the box. In the case of a box it's just six planes, each bounded by a 
rectangle. Note the brep is not a triangle-mesh, but a list of bounded 
mathematical surfaces that define the exterior surface of the solid 
geometry exactly. Next, when you subtract the cylinder, the CAD software 
will start with the box brep data and modify it to include the hole. 
You'll end up with a longer list of curved surfaces and planes bounded 
by curves and straight edges.

In POV, it literally just stores the box and cylinder, with a flag to 
say the cylinder is subtracted. Nothing else is calculated or stored. 
There is no concept of the "edge" between the two stored anywhere at 
all. It's only when you come to raytrace the scene, pixel-by-pixel, that 
the edge appears in the image.

Now consider how to add a round on this shape. In the CAD software it's 
just a matter of choosing the edge from the ones in the brep, and 
replacing it with a curved surface following that edge (and adding in 
suitable boundaries for the other surfaces affected). In POV no such 
edge exists, so you can't even choose where to apply the round! What you 
would need to do, is write specific code for every possible combination 
of shape intersections (sphere-sphere, sphere-cylinder, sphere-box, 
box-cylinder, ...) AND handle every possible case where one of the 
shapes is already bounded by another shape. That is *a lot* of maths and 
*a lot* of combinations that need to be figured out and hand-coded. It 
might not even be possible mathematically for some combinations.

The only feasible way for POV to be able to have this feature is for it 
to follow the CAD way of doing things and keep a brep of the shape. But 
this would be a gigantic undertaking from the way shapes are defined and 
stored, the way CSG is calculated, and how the raytracing intersections 
are done. IMHO it would then be a different piece of software rather 
than an "update" or "patch".

BTW there are free CAD packages available that do what you want, eg:

http://www.freecadweb.org/


Post a reply to this message

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