Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Light mask functions slightly inconsistent with geometry sizes #47

@peter-spencer

Description

@peter-spencer

There is a slight inconsistency between the Light mask functions, e.g. cube_mask vs geometry.Box

Calling Box(X,Y,Z) creates a box with sides of length X, Y, and Z respectively.

Calling pvtrace.light.light.cube_mask(X,Y,Z) returns a random coordinate between (-X --> +X,-Y --> +Y, -Z --> +Z) which is a volume equivalent to Box((2X,2Y,2*Z)).

This works well because the Box() is centred on (0,0,0) by default, so the resulting Box() and Light() behave the same when transformations are applied to move and rotate them.

I had at first assumed that the coordinates supplied to Light() behaved exactly like Box() but this was my mistake as the code is clearly commented; I thought I'd flag this potential confusion for other users. I'm not sure whether it needs fixing because changing the behaviour could break existing code.

Perhaps an optional future feature could be added to make a geometry object into a light, or use as a template for a light source?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions