Skip to content

Bounding Box and ShapeNumber-Image questions #283

@rsaccon

Description

@rsaccon

Long, long time ago I experimented with libfive, but because it wasn’t written in Rust it was not a good fit for my use case and workflow. Now we have fidget and I like it very much. I started tinkering around towards a 3D graphical editor which syncs with script code. Right now is just a slightly modified viewer demo, where one can mouse select the different shapes (and later, the idea is to allow operations on the selected shapes)

The first question I have: How can we get bounding box of a shape ? Unless there is a better way to do it, I need the bounding boxes for centering and scaling-to-fill-the-view of the shapes. In mesh based modeling we just iterate through the vertices to find min and max for each dimension. In case it is non-trivial in fidget, I thought one could just turn shapes into a mesh (if it is fast enough now), but I hope there is a better direct way.

The other issue is more like a suggestion, somehow related to PR #282

On the rendered shapes on screen, to associate a mouse click position with a shape, I keep the following data structure:

/// Single-channel shape-number image
pub type ShapeImage = fidget::render::Image<Option<u16>>;

Would it make sense to make such a definition part of fidget, like the depth and norm maps ? I think, for any kind of UI interaction with rendered shapes something like this is needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions