Print at Dec 18, 2025, 3:00:55 AM

Posted by skunk at Aug 26, 2017, 12:22:00 AM
Editing a group of vertices
Hello,

I'm starting to play around with SH3D, to see what I can do with it.

One thing that I'm missing, and that others here may find useful, is being able to edit the home not by moving a group of objects, but by moving a group of vertices belonging to one or more objects.

(I tried the Advanced Editing plug-in, by the way, but did not find it particularly helpful.)

This would address the case of moving a wall and associated room definitions simultaneously, as well as more complex cases like extending an entire side of a house. If anyone here is familiar with AutoCAD, the idea is basically that program's STRETCH command.

I poked through the source code a bit to see how feasible it would be for me to implement this (the feature-request list is very long!) and I did seem to get an answer as to why SH3D's current behavior is as it is.

I see that vertices, like wall endpoints and room corners, are not first-class objects, but are instead simple fields within the associated objects. Thus walls and rooms are selectable, but vertices are not.

So what would be the best approach to make individual vertices selectable and editable/movable?

My first take would be to define a new object, let's call it VertexSubset, that implements Selectable. It would contain a reference to a normal home object (e.g. Wall, Room), and a variable-length array/vector of integers that indicate which vertices of the referenced object are "selected."

This would express the notion of (for example) vertex 0 of Wall A, vertices 2, 3, 4 of Room B, and so on. (A VertexSubset that denotes all or none of an object's vertices would be a degenerate case, and should probably be avoided in favor of no object or selecting the object in the normal way.)

Moving the VertexSubset would then modify the referenced object by moving only the indicated subset of vertices. (Obviously, moving multiple VertexSubset objects would affect multiple referenced objects.)

The GUI selection logic would need tweaking to make it possible to select vertices in this way, creating VertexSubset objects on-the-fly as needed.

Does this sound sane, or would a different approach be a better fit?