New precision modelling and transformation addon proposal, early feedback

I am working on a new addon, it has a lot to do with precision modeling and custom transformations. See below for the description and mockups.

In any mesh model, there are relationships between primitive parts of the mesh (verts, edges and faces).

For example:

  • A particular feature might be repeated radially, at a distance, around an imaginary axis
  • A feature might begin one third of the way between two other features (a conceptually simple location, but tedious to actually determine and input for practical usage)
  • Certain features might repeat at specific/precise distances from one another
  • Two or more sets of faces might be coplanar and not aligned to any major grid axis
  • There may be a precise regularity to the position of certain edges (or even whole features) that is difficult to achieve with existing tools. These could be angular or distance relationships, for instance, and the relationships could be linear, geometric, logarithmic, etc.

During the modeling process (edge modeling is the target), it is sometimes difficult to construct desired geometry (especially precise geometry) for a given area, because it is difficult to directly access and exploit the relationships between mesh elements in a practical/precise way (to get a resulting unique transformation).

We are left with a series of workarounds and intermediate transformations that allow us to get the results we actually want, and certain things really aren’t practically possible (unless you want to get vert coords and do lots of tedious math).

The addon I am building will allow you to construct custom transformations from existing or imaginary geometry data that you can grab directly from your mesh. So, if you want to rotate a portion of your mesh around an imaginary axis, you can do that (just specify the line by grabbing two points, or an edge, or the cursor, or input the coords yourself). Or if there are two distant, disconnected flat features in your mesh, and you want to align them so the flat parts are coplanar, you can do that without interrupting the surrounding geometry (you just apply the transformation to the selected portion of the mesh…the transformation is based on the flat part you specified though).

Plans for how it will work:

Right now, I plan to let users create special “primitives” like “point,” “line,” “plane,” “transformation,” or “math/calculation.” The geometry primitives will allow you to grab coords in a variety of ways, as mentioned above (3d cursor, direct input, grab from geometry). A “math/calculation” primitive will allow you to get intermediate calculations (like the angular difference between two lines or the distance between two point primitives) or to input numbers or perform basic math operations like division. Transformation primitives will allow you to apply your transformation (it will generate a transformation matrix that you can multiply with other matrices). There will be a variety of built-in transformations, like “make lines collinear,” “make planes parallel planar,” and simpler transformations like translations, rotations, etc. You can apply your transformation to a portion of a mesh, an individual mesh elements, or to an entire mesh object (if you want to align objects in this way, for instance).

I am working on the data handling portion of the addon now, so here is my only mockup so far (it shows the main list of the user’s primitives, with one point selected):

Please let me know if you have any feedback on this concept so far.

Some great ideas. I’m sure once some of it is working, there’ll be quite a few people using it and giving you feedback.

How is this different than what you can do with custom transform orientations, and using the 3d-cursor as a pivot point?

For example, you can select any three verticies, duplicate them, rotate them around any existing axis orientation, save them as a transform orientation, select that transform orientation, move one of the points relative to it a precise amount, snap the 3d cursor to that point, delete the 3 points, select some other geometry… and now you have a totally custom rotation axis around a totally custom point, specified precisely.

Perhaps you could explain a very specific transform or rotation you have difficulty doing?

Interesting. I’ll bookmark this thread for now to keep tabs on further development.

davesf, good question. Part of the motivation for me making this thread was to gather information about the ways people do things, and to find out what the best ways of doing things currently are. It may turn out that some or even most of the features and use cases I have in mind might be solved already. Which is why I want feedback, to determine what’s most and least valuable to work on and implement.

About the case you mentioned in particular dave, my addon would save you from having to duplicate points and cut out some of the extra steps (it allows you to directly specify the axis by typing, grabbing from the 3D cursor, or grabbing existing vert or edge data from real gemoetry for the coords of each of the two points in your axis). And, if you have several transformations you need to accomplish to achieve a desired result, you can build the transformations as primitives (they are stored as transf matrices) and multiply them together before applying them (which will give you the combined result by pressing apply once).

The real use case for my addon would be for when you need to perform odd precision transformations while constructing your mesh in edit mode (for people who need precision or don’t like eyeing things). It would eliminate the need to manually measure or calculate things, you simply specify “a third of the way between this point and that” (by building it with the provided math and geom primitives) without having to deal with any numbers or write anything down, or copy and paste numbers from some other intermediate location. The goal is to expose and specify the relevant information directly, so it can then be used to build the appropriate transformations.

There are many potential cases to consider. It is sometimes difficult to find practical, concrete illustrative examples for these because the unique circumstances people encounter when constructing a mesh often require weird/abstract transformations. And the number of unique cases is also very large.

Here’s one that I can think of now:

  • Let’s say you have two pyramids, rotated in free space (since we’re constructing a mesh, assume they’re part of the same mesh). How would you smoosh them face to face (side to side, so they were coplanar)? Another way to describe it would be to say that they would be tilted off base, so that one side of each was resting against the other.

I’m curious how you would do this in your proposed tool…

If I can modify the question to… how would you create a mesh that is two equal pyramids, freely rotated, smashed face-to-face.

I would make one pyramid, select three points of a face, create a custom transform orientation and select it. snap 3dcursor to center. Select the other two points of the pyramid, duplicate them, rotate them 180 degrees to the other side, then connect the edges and faces.

If I already have two existing pyramids, the task is underspecified. Are the faces merely supposed to become coplanar, or are the verticies of the joined face supposed to match? If so, are the pyramids identical? If so, I’d probably just delete one of them and use the procedure above.

davesf, this is interesting, it’s helpful to understand what your solution is with existing tools. Yet, it still seems that this particular problem is somewhat difficult and indirect to solve this way. Even further, imagine that we had two objects with flat areas that weren’t symmetrical that needed the same treatment (repositioned so the flat areas rest against each other).

I have a working version of this function, but it is ugly and destructive (and there are bugs, it’s not suitable for release at all). The way I do it now is make two lines starting from the same vert on each face and get the cross product (which gives me a line at right angle to these). Then, I get the rotational difference between those two cross products (rot diff is a function exposed in the python api), and rotate my target mesh by the difference. This works on any two pieces of a mesh, or on any two objects (the working version only does two distinct objects at the moment), even if they’re completely different topologically.

To accomplish this, the user selects three verts from the source pyramid, stores a face, selects three verts from the destination pyramid, stores another face, and applies a transformation to the first pyramid.

Here’s a new example: If you had two different pyramids rotated in free space, part of the same mesh (one short and fat and the other tall and skinny), and you wanted to make the base of the first one a third the side length of the second one. Conceptually simple, but how easy is this to do now?

With my proposed addon, you would:

  • select an edge (on the base of the second pyramid, our destination) and grab that data with a line primitive,
  • use a math primitive to get the length (or simply access this data, which might be a built-in attribute of the line primitive)
  • use another to divide that result by 3
  • then use another line primitive to grab the edge data from your first pyramid (the one we’re scaling)
  • create a transformation primitive (there’s a built in function for this called “scale match” which comes up with a scale factor to match the first length to the second length (again you can type numbers, use numbers from other math primitives, or use edges directly here) and apply it to the selected first pyramid

I hope that makes sense and illustrates another use case which is better solved with my proposed addon. There are also a variety of ways you could do this with my addon. You could simply scale match the first to the second, then scale the first by .3333333 yourself, for instance (but you get the idea).

I think this system could be implemented as nodes in fact, which is interesting considering that maybe one or two releases ago the python api exposed node systems to developers (if I’m correct). But, I’ll try to get the current idea up and running first before going in this direction.

Why don’t you record a short video describing your use case with and without your addon? That will help everyone understand the problem better, no?

If anyone is still interested, here is the current state of the addon, it is only partially complete, so it only allows you to store some geometry data in a list (paste it into a text file in the text editor and click the run script button at the bottom to use it, it will show up at the bottom of the scene panel):

But it is still being worked on (as recently as today).

Here’s a screenshot, this is what it looks like when you run the script currently:

New thread to come soon.

In case you still don’t know what the addon is eventually supposed to do, read one of my stackexchange comments:

The purpose of the addon is to allow users to construct precise custom transformations that they can apply to meshes or mesh parts while modelling. The geometry primitives are there to give users ways to specify/describe geometry without actually having to build it in their scenes (they can grab from existing geometry, the 3d cursor, or type in manually), which is useful if you want to specify an imaginary axis of rotation for instance. There are other primitives too (unbuilt), these allow you to measure and perform math on geometric quantities (like point distance, angle between lines, etc.)

Update The initial version of one of the addon’s function is done!

If you want to get an idea of the kind of stuff this addon will be doing (precision custom transformations), check these out (the addon is in the panel “MCT Tools Alpha” on the right):

This is a relative transformation (I called it “Point Match” for lack of a short/better name). That list at the top lets you add geometry types (point, line, plane) and some other types (calculations and transformations). I added two point primitives to that list to store the point info for this transformation (the coordinate info for those points can be grabbed from the 3D cursor or from your mesh, or typed in etc.). I picked the point of the pyramid as the source, a point (vert) on suzanne’s head as the destination, and used the “Point Match” transformation item (you can see it in the list) to apply the transformation. This will work on mesh parts within the same mesh while modelling too.

So, in the future, there will be many more transformation types (and I’ll probably let you construct your own transformation matrix using the utils in the python API), and there are a lot of extra functions and another data type that I haven’t built into the addon yet. So eventually, anything you can measure (distance between points, angle between lines, face normal angles, etc.), you will be able to make custom transformations based on that (nearly). And you’ll be able to do math on all of that stuff to modify the transformation before you apply it (so you can, say, move a third of the distance shown in the screenshots, for instance, by dividing that distance by three).

The data access and interface are in a usable state, but a lot of stuff is incomplete. Right now, this transformation only works on objects that haven’t been transformed (so apply your transformations if you want to use it). And remember, use it at your own risk (the addon isn’t built to deactivate itself yet so best not to save things right now).

All panels:

Here’s the code if you want to try it out (GPL btw, paste it into the text editor in blender and click “Run Script” at the bottom, it will show up at the bottom of the scene panel):