POV-Ray : Newsgroups : povray.general : Mesh rotation and inside_vector : Re: Mesh rotation and inside_vector Server Time
27 Sep 2024 01:15:45 EDT (-0400)
  Re: Mesh rotation and inside_vector  
From: William F Pokorny
Date: 21 Aug 2024 14:41:20
Message: <66c634d0$1@news.povray.org>
On 8/21/24 12:05, Ilya Razmanov wrote:
> Greeting wise ones,
> 
> When fiddling with meshes I came to conclusion that, if I rotate a mesh, 
> inside_vector assigned to it does not rotate together with mesh. As a 
> result, if I build a CSG like intersection with mesh and start rotating 
> that CSG, some imaginary parts appear and disappear from/to nowhere.
> 
> Is there any way to glue inside_vector to mesh so it gets transformed 
> together with it?
> 

Hi.

This is likely a longstanding bug in the official releases of POV-Ray. 
You are correct the inside vector should be rotated (transformed) along 
with the mesh - otherwise the inside test is unstable(*).

I proposed a fix to this many years ago on the developer mailing list 
and posted a pull request to github to fix it. At the time clipka 
suggested an alternate coding and I, either updated my pull request to 
that, or closed and submitted another exactly pull request which was 
exactly his suggested code(**).

I kept the pull request current via re-basing for many years, but it was 
in a collection of pull request from me never merged into the the 
POV-Ray source code. I closed all my pull requests on deciding to pursue 
my own branch (povr -> now yuqk) maybe 5-6 years ago. That closed pull 
req on the official code is very likely still searchable on github. I 
don't recall the fix off the top of my head. I confess I have not been 
doing much with POV-Ray of late - and I find myself too lazy in the 
moment to search for it (sorry).

Bill P.

(*) - There also is / was a longstanding unfortunate suggestion to make 
the inside vector axis aligned (and so problematic with many meshes) in 
the official documentation which I suggested be fixed too... Last I 
looked, the documentation had not been updated either. Some random 
vector would be better suggestion - and the truth is the vector should 
be set so as not to be parallel (or near parallel) with any face normal 
in the overall mesh.

(**) - clipka's fix was adopted in the yuqk fork. So it exists there, 
but off the top of my head I don't remember what it is well enough to 
suggest how to find it in the source via a search - and the yuqk code 
base is many thousands of changes different than POV-Ray proper these 
days, anyhow. What's found there probably won't exactly map to the 
official code base, though the core of the change will be exactly what 
you suggest for an update.


Post a reply to this message

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