Skip to content

[CSG]: Camera starts at hardcoded position #228

Open
@Cloud7050

Description

@Cloud7050

CSG currently uses a hacky method of setting the initial camera position, adopted from the way JSCAD does it on their website. The camera starts at extremely far coordinates, then uses the "zoom to fit" feature (which is also run upon the initial render) to zoom to an extremely small scale.

https://github.com/Cloud7050/modules/blob/9624a2619e5055e6a33490204e319fbb0efd2f86/src/bundles/csg/stateful_renderer.ts#L38

In theory, if Operables are scaled to an extremely large size when rendered, the initial camera position can be inside a Shape and the camera direction calculations may bug out.

Ideally, a dynamic starting camera position will get calculated based on the actual bounds of everything being rendered.

See also Cloud7050#7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug[Category]minor[Priority]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions