Open pca006132 opened 2 years ago
This could be a very powerful feature. I imagine it being most useful in combination with a UX input (click - raycast, select triangle or coplanar face or sharp edge or ...) and do an operation. It might even be useful programmatically, though I need some examples to visualize.
I think we should start by listing out specific operations that seem like they have good utility and use those to help develop an API. The shape of the API will help guide an implementation. For instance, I bet that beyond just selecting existing verts/edges, it'll need to remesh to create verts at the desired boundary, either before or during the operation. Consider e.g. a fillet on a cube, where new verts will need to be placed to anchor the existing surface at the edge of the operation. So in a sense, part of the original edge was changed by the operation, but another part was not.
So for your usecase, I guess it would be some sort of a area selection using another manifold? I think it still makes sense to have face selection for offsetting, not sure how to represent that with area selection.
Selecting a region to operate on by intersecting with a temporary manifold is an interesting idea. It's going to get hard going much further without some visuals though. Even if it's just sketches on a napkin, I'd like to see what you mean by face offsetting.
For specific operations, here are some that I can currently think of:
And in addition to these operations, it may be useful if users can designate a certain vertex/edge/face and refer to its coordinate in other parts, i.e. #193.
I somehow think that https://github.com/openscad/openscad/issues/4605 can be slightly related to this, i.e. we may want to define some features for our primitives and allow users to refer to them. In addition, maybe we can use the mesh relation API, identify adjacent faces with different source meshes to determine edges introduced due to boolean operations, and perform some operation on them (such as fillet or chamfer)?
Just brainstorming here.
Agreed, I've daydreamed about this kind of thing too. Already the mesh relation will let you semantically identify e.g. a cylinder from its remaining facets. I'm not quite sure what one would do with it, but the data's available at least.
For some functions such as smooth, it might be desirable to only operate on a subset of vertices/edges, for example to make round edges or add fillet. I think it may make sense to allow users to filter edges/vertices via custom predicate, and allow users to mark vertices with unique IDs for tracking after other operations.