POV-Ray : Newsgroups : povray.general : no_image ignored in nested (difference > union > object) CSG member : Re: no_image ignored in nested (difference > union > object) CSG member Server Time
25 Apr 2024 16:49:10 EDT (-0400)
  Re: no_image ignored in nested (difference > union > object) CSG member  
From: Oblomov
Date: 24 Mar 2020 09:15:00
Message: <web.5e7a07a4e0d49d83393d37fe0@news.povray.org>
Hello,
and thanks for taking time to look into this and provide an explanation:

William F Pokorny <ano### [at] anonymousorg> wrote:

> > illustrate the odd behavior: both walls are rendered. Replacing the `difference`
> > with a direct use of the object `object { Pair pigment { color White } }` works
> > as expected, as does using a union instead of a difference (in both cases, a
> > single wall is visible, albeit with a shadow cast from the other, invisible
> > wall).
> >
> > I'm not entirely sure if this behavior is expected or a bug. In the latter case,
> > should I open a GitHub issue?
> >
>
> Hi,
>
> I believe what you see is expected behavior

I was actually hoping for this to be a bug, since achieving the same effect will

to be able to define a Room object with all the walls and floors and ceilings

guess now I'll have to build the rooms without the see-through wall at all and
then add it (with the no_image tag) as a separate object. I guess I'm lucky I
don't need to operate complex transformations on the rooms themselves, so this
will be relatively easy.

> - though not sure it's
> anywhere documented(1). What happens for an end result with no_image and
> similar object modifiers can get complicated.

> Object modifiers like no_image don't - generally - propagate through csg.

Hm, I'm guessing the problem is deciding what to do for the subvolumes
intersection of components with different attributes: do you take the union of
the attributes there, or their intersection? E.g. in the documentation examples,
assume one sphere is no_image and the other is not; do you show the volume
corresponding to the intersection because at least one has no_image off, or do
you hide it because at least one has no_image on? I can see why both would be
acceptable answers depending on what the user wants, and thus the developers may
have opted for essentially ignoring the attribute for the single component.

> That said, union is a special case because shapes withing the unions are
> flattened / unnested to the top and bounding is applied to each
> component there. Further, unions don't potentially 'ignore' surfaces.
>
> You can code up a difference as difference { Pair pigment...} and that
> should work because the parser, IIRC, basically ignores the difference
> creating a top level object which in turn is the flattened union. And
> I'm not sure why this one, odd difference encoding works...
>
> It could be argued your particular difference with a null box is the
> same thing, but handling all the sorts of situations where this might be
> true in csg generally is probably never going to happen - and I don't
> think there is much point trying to make it work.

Well, my actual code is much more complicated than just a difference with a null
box, but even in that case I was actually expecting it to work, since at least

of intersections and merges.

> (1) - With respect to documentation, it might be worth posting a pointer
> to this thread in povray.documentation.inbuilt asking if deeper
> documentation related to the propagation of object qualifiers exists -
> and I've missed it. If not, whether some such documentation should be
> added to the inbuilt documentation. Jim - who currently handles all
> documentation - should at some point see it.

I'll do it, thanks for the hint.


Post a reply to this message

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