POV-Ray : Newsgroups : povray.general : output file saving Server Time
18 Apr 2024 03:09:25 EDT (-0400)
  output file saving (Message 11 to 11 of 11)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: GioSeregni
Subject: Re: output file saving
Date: 4 Mar 2020 15:25:06
Message: <web.5e600d9b7018a2442c923fbd0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 04/03/2020 à 03:57, GioSeregni a écrit :
> > "Bald Eagle" <cre### [at] netscapenet> wrote:
> >> "GioSeregni" <gms### [at] hotmailcom> wrote:
> >>> sorry if I insist on off topic but I think it's something to know.
> >>> I am reviewing the code of my libraries. I have had confirmation that removing
> >>> the "difference" from the loops is gaining 3/4 of the time.
> >>
> >> Yeah, difference{} can be a killer if it's not implemented in a way that
> >> optimizes its usage.
> >>
> >> You might find this enlightening as well:
> >> http://www.econym.demon.co.uk/holetut/index.htm
> >
> > Yes, but in my last example the geometric shape has identical result, even if
> > described in two different ways.
> > I believed that theare are infinite way to render light and surface, because
> > they depend on the programming of each user.
> > But I thought that the forms, which instead have a unique and indisputable
> > spatial result, were optimized and stored in a internal database, by the parser,
> > in its best way.
> >
>
> The problem of difference optimisation is the bounding box.
>
> Plane have infinite bounding box, so they are killing the difference
> optimisation. Something that does not occurs when clipping.
>
> It might be worth testing with a box instead of plane (as small as
> possible box to make the same as the plane did, even if it is a bit more
> complex to describe (due to having to rotate the box to match the normal
> vector of the plane)

Great idea, many thanks!
The same complex palm shape, molded with "difference", over 12 minuts (argh!!!).
Updated using "clipped_by" plane, 3.41 minuts.
Your new system, "clipped_by" box, 2.43 minuts.
The palm has over 600 leaves
This (your) new code (for each leaf).
It was easy for me, I use my parser from AutoCAD.
I have only manually cleaned a bit of verbosity in the rotations, the cad
rotates twice. On then plain (2D), then for the block (3D).

#declare Subpalm0 = object{sphere{<0,0,0>,1 scale<.5,.2,1>pigment{colour OLIVE}
finish{ambient (0.45 * AmbientFact) diffuse .7}
 clipped_by{box{<1,5,5>,<-1,-5,-5>translate<-1,5,0>rotate<0,0,-13,>}}
 clipped_by{box{<1,5,5>,<-1,-5,-5>translate<1,5,0>rotate<0,0,13,>}}
 scale .30 translate<0,.0,.30> rotate y*-100
}}

PS. I think to continue further, shearching the minimum needed for the bounded
box.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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