Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#136 Mixing smooth and flat overlapping BoTs gives bad results

open
nobody
Raytrace (49)
4
2007-09-25
2007-09-25
Sean Morrison
No

Ran into a curious case where if you have two geometricly identical overlapping bots where one is smooth and one is not, the raytrace will be wrong. Most disturbing is that the bug even occurs if the overlap is from a negative space object (e.g. BoT used in a subtraction).

The problem can be seen with a simple sphere and a box used to cut the bottom half of the sphere off. Turn the sphere into an BoT, create a region for the bottom half that intersects the box with a usual unsmoothed BoT sphere, and create a region for the top half that subtracts the box from the *smoothed* BoT sphere.

The result should be a unsmooth BoT base to the sphere and a smoothed top portion. The result is an interleaved smooth/unsmoothing throughout.

Discussion

  • Sean Morrison
    Sean Morrison
    2007-09-25

    See the SMOOTHBOT and BOTSMOOTH top-level objects

     
    Attachments
  • Sean Morrison
    Sean Morrison
    2007-09-25

    Logged In: YES
    user_id=785737
    Originator: YES

    File Added: botbug.jpg

     
  • Sean Morrison
    Sean Morrison
    2007-09-25

    Screenshot of the bug, should be smooth grey top and flat green base

     
    Attachments
  • John Anderson
    John Anderson
    2007-09-27

    Logged In: YES
    user_id=1185553
    Originator: NO

    This is another effect of the way that rt_boolweave operates. The problem is that rt_boolweave weaves the segments from the intersected primitives together, without knowledge of the Boolean operations that will be applied. In this case, two BOT primitives are intersected resulting in identical start and end points for their segments. These two identical segments are passed to rt_boolweave and it chooses one segment (whichever one it got first), to represent that segment. This segment is passed to rt_boolfinal which does the Boolean evaluation. It knows that the one segment represents both BOT primitives, and correctly performs the Boolean evaluation resulting in a Partition with the correct start and end points. The application (in this case rt) then calls RT_HIT_NORMAL to get the surface normal. RT_HIT_NORMAL calculates the surface normal based on which primitive generated the segment. Unfortunately, in this case, it may be the wrong primitive, resulting in an incorrect normal.
    This is the same problem that produced bug #1203344.