POV-Ray : Newsgroups : povray.binaries.programming : Fix for improved intersection routine for CSG-Intersection objects - csg.cpp (1/1) Server Time
21 Dec 2024 21:56:00 EST (-0500)
  Fix for improved intersection routine for CSG-Intersection objects - csg.cpp (1/1) (Message 1 to 2 of 2)  
From: Andreas Kaiser
Subject: Fix for improved intersection routine for CSG-Intersection objects - csg.cpp (1/1)
Date: 13 Jan 2004 04:59:00
Message: <4003c00f.84804802@news.povray.org>
Attached you'll find csg.cpp with an improved intersection routine for
CSG-Intersection objects (together with two small but necessary
changes in Union- and Merge-intersection).
To use this version of csg.cpp you must add a new define

#define CSG_SIBLING_IGNORE_FLAG 0x2000000L /*AKA: csg internal flag*/

to objects.h.
I've checked it with each scene file in the distribution that contains
intersection and/or difference objects and it should be ok now.

Bad News: Almost no difference for benchmark.pov (but see my reply to
a post of Christoph Horman in povray.programming).

Below you'll find some timings for my two private builds

- POV-L1R:	almost original (just changes to compile)
- POV-L2R:	improved CSG-Intersection (1st fixed version)

The files below were traced with [640x480, AA0.3] (AA being switched
off due to focal blur for chess2.pov).
Values are PPS / totaltime in sec.

				POV-L1R			POV-L2R
=====================================================================
advanced/chess2.pov:		1616 / 186		 2287 / 134
advanced/grenadine.pov:		2145 / 143		 2877 / 107
advanced/whiltile.pov:		7333 / 42		 8474 / 36
incdemo/shapes.pov:		8533 / 36		10108 / 30

Andreas


Post a reply to this message


Attachments:
Download 'csg.cpp.txt' (28 KB)

From: Andreas Kaiser
Subject: Re: Fix for improved intersection routine for CSG-Intersection objects - csg.cpp (1/1)
Date: 13 Feb 2004 15:19:54
Message: <81cq20h81d1rvagleafjjskhv5n6l7o0qf@4ax.com>
On Tue, 13 Jan 2004 09:59:00 GMT, kai### [at] siemenscom (Andreas
Kaiser) wrote:

>Attached you'll find csg.cpp with an improved intersection routine for
>CSG-Intersection objects (together with two small but necessary
>changes in Union- and Merge-intersection).

(I'm replying to myself here)

If you use this patch you should not place the subtracted objects into
a union/merge object.

Instead of 

intersection // or difference
  {
  object1
  union
    {
    object2
    object3
    ...
    }
  ...
  }

you should use

intersection // or difference
  {
  object1
  object2
  object3
  ...
  ...
  }


-- 
Andreas


Post a reply to this message

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