Discussions for "Better snapping and precision modeling"

You can already see some of the changes commented on in the original post in the Snap Utitlties addon:

Remembering that these changes would be an early step (to solve the immediate problem).
Nurbs will benefit from these changes.
I agree that the snap on the rotate operator needs attention. But I think the idea of choosing a base point would be a good start before we propose new solutions.

5 Likes

and then the magic appears …
it seems like a great start!

that’s what made your video come to mind:

for an effective single edit mode that also has “fake nurbs”
I think you could have a single edit mode but with the addition of two other selection modes
1 “surfaces” which are the selection of entire surfaces (a collection of polygons that have the shape of the nurbs surface)
2 “loop Segments” that would be the selection of segments (a collection of edges polygons that can also form curves) similar to that of moi 3d

with obviously the right visual feedback for these two modes

so they would have:
vertex select, edge select, face select, surface select, segment select

I hope you understand the meaning of what I mean

Noki, you’re confusing nurbs with BREPs. Trimmed nurbs surfaces are used as an intermediate step to create a mesh for BREPs, but whenever you describe nurbs, you seem to be referring to solid modelling or BREP. Nurbs are just surfaces which can be trimmed, extruded, shaped in a freeform manner, etc. In other words there is not much more to these geometry types than what Blender is already capable of. BREPs are nondestructive representations of volumes defined by operations like projections, extrusions, sweeps, booleans, holes, and bevels which can be used to create or modify a solid volume, without a lot of the limitations you see on polygonal operations. For instance mesh booleans are non-associative, and have often fail when calculating co-planer faces or when multiple vertices sit in the same location. Mesh booleans usually require modifying the resulting mesh by hand to prepare the surface for later operations like bevels. BREPs don’t care about these limitations. They mathematically calculate the volume and represent it using nurbs surfaces which are then used to generate mesh surfaces for display, plotting, and renderin

This is off the topic of what I’m saying Blender is badly in need of. Believe me I would love for BREPs to be natively supported. A STEP importer would be nice,too. Because that would mean I could fully ditch Autodesk products, but that’s not what I’m really looking for here. I want a way to quickly place, rotate, and scale an object with enough precision that it is quick easy to make renderings of mechanical components and architecture, for instance, without a lot of headache. It is an achingly absent feature of Blender. One that isn’t missing from any other rendering software I’ve used in the last 20 years.

1 Like

I know what the nurbs are, and no I’m not confused …
If I talked about “fake nurbs” there’s a reason, and I think it’s an excellent solution around the corner and it’s to create a visual representation of “fake nurbs” that are created and processed by tools and manipulators that build mesh surfaces that are very similar to the shapes of the nurbs surfaces but would always be modeling mesh.
I mean a collection of tools that create surfaces similar to what this addon does


if I want to create a solid model this would be composed of so many “fake nurbs” surfaces (that are always mesh ) … the sense of all this would be to have the advantages of modeling nurbs made of Booleans,and trims operations (for this reason I wrote that they need better boolean) and modeling precision on mesh modeling.

is not necessary to have nurbs and not even breps, it’s something new that you could get “with little effort”

And I do not think it’s off-topic, otherwise what would you mean by “precision modeling”?

1 Like

All these fancy (and no doubt useful) features are being discussed while you can’t even change the snap increments in blender!

This is necessary.

3 Likes

just as a point of study and inspiration …
for those who have not already done so, take a look at how the creator of QBlocker has developed a discreet and interesting quick snapping method

3 Likes

mechanical blender author has created a series of many small snapping functions that since they fully follow the blender workflow philosophy, they should be taken into account, or at least take a look at his videos and his build as he operates, to draw from them positive ideas

I attach the link of his demonstration videos, just as a starting point for study

2 Likes

rhino snapping tools is very power full and good refrence for blender developer
osnap_center

http://docs.mcneel.com/rhino/5/help/en-us/user_interface/object_snaps.htm

1 Like

blender need smart track system can speed up modeling and precise
rhino have good smart track system
smarttrack-001
http://docs.mcneel.com/rhino/5/help/en-us/options/modeling_aids_smarttrack.htm
http://docs.mcneel.com/rhino/5/usersguide/en-us/html/ch-05_accuratemodeling.htm

3 Likes

that mechanical Blender seems like a next gen thing. Is the development stalled from a couple of years ? will be only for 2.7 ?

I don’t know, it’s a project outside blender and managed by some guys who would like CAD in blender …
At the time there was no response from the main devs so they created this alternative version …
I hope that one day this series of patches will be considered (obviously updated to blender 2.8) because I believe they are really very valid.

4 Likes

My background:

Retired, but still only 62 years old.

Qualified Engineering Drawing Teacher, Mechanical Engineer, Mechanical Designer, IT Developer. Started in drawing office 1978, started with CAD 1981.

CAD Packages used: Intergraph IGDS, Bentley MicroSystems, Matra DataVision (Euclid), SolidWorks, IBM Catia, FreeCAD. AutoCAD in 1987, briefly - hated it!

As a design engineer I can see many things I would like in Blender to make drawing mechanical parts better (CAD Functions), along with the suggestions already made here, might I also add:

  1. Ability to extrude a vertex, or series of vertices, by a delta coordinate from its position, or by a delta length and rotational angle relative to the view plane.

So a workflow like: select vertex, extrude, key DC 1.2,1.4,0 extrudes the vertex 1.2 in X, 1.4 in Y and 0 in Z. Or key DR 1.3,45 extrudes the vertex 1.3 at an angle of 45 degrees relative to view positive X (3 O’clock).

  1. Ability to use a “Tentative Snap” (T-snap) to an existing vertex.

So a workflow like: select a vertex, T-snap any existing vertex, accept this location, or key a delta offset like DC 1.2,1.4,0 or DR 1.3,45. This gives us the ability to use another vertex on the model as a starting point for a delta offset.

  1. Ability to use an absolute 3 axis location.

So a workflow like: select a vertex, extrude, key XY = 1.4,2.6,3.0 this extrudes the vertex to the absolute coordinate given.

  1. Ability to input an absolute, or T-snap + delta input to place a new single vertex.

So a workflow like: add vertex, key XY 1.4,2.6,3.0 or T-Snap existing vertex and key DC 1.2,1.4,0, or key DR 1.3,45.

  1. Ability to add primitive shapes at absolute, or T-snap + delta input.

So a workflow like: add rectangle, key XY 0,0,0, key DC 2,1.3 creates a rectangle with the bottom left vertex at 0,0,0 and the top right vertex at 2.1,1.3,0.

It is assumed that 0 input need not be added, so DC ,3 means delta 3 in Y axis, for example. XY 0 means all inputs 0, etc.

  1. Close a polygon after so many vertices have been added.

So a workflow like; add vertex, extrude, key DC 1.2,0,0 key DC 0,1.4, etc, etc, some command to close the polygon, i.e. join the last vertex to the first one.

The ability to create a single vertex and then extrude it around a coordinate defined path then close it is a fundamental requirement for CAD. The ability to tentatively snap a vertex and use this to place a new vertex, or extrude an existing one will greatly improve the workflow and reduce the time taken to create geometry.

  1. The ability to create “parts” of geometry in a library. I know you can do this by creating objects in a blend file and then appending them, but the workflow is not CAD friendly.

So a workflow like; create a geometry - a bracket for example, that will be used extensively in the model, or in many models. Add this to a “Parts” library so it can be easily recalled later (think Pose Libraries…). Each part has an origin and is placed with the origin at the cursor location, or using a T-snap and delta input.

  1. Ability to extrude a vertex along the path defined by itself and the previous vertex, or to extend the vertex along the same path without adding a new one. So if you have an edge from 0,0 to 3.4,5.3, extrude this to make a straight line of three vertices, or move the end vertex in line with the path defined by the two vertices by a set distance, i.e. make the line a bit longer without changing the angle of the line.

Imaging here you have made a hydraulic cylinder at an angle of 23.45345 degrees to the horizontal and you want to make it 2cm longer, without that operation taking you half a day…

  1. Ability to rotate the view by a set amount, like say 46 degrees about its normal axis for example, or 37 degrees about the global X axis.

As a design engineer working on a drawing board, I would start with construction lines and work from there, I don’t see the need for this in Blender, if T-snap & delta inputs can be achieved. Things must line up in technical drawing, so T-snap is a must. In all the products I have worked with, Intergraph IGDS was the easiest to use to rapidly create precise geometry. It had a “T” button on the cursor and the ability to input 3 axis absolutes and delta offsets. It also had a Parts Library, although it was called a “Cells Library”.

I don’t see these additions as a large amount of work by the way, just some additional key-ins and the T-snap to make life such easier. The other function I used extensively in those days was “Copy Parallel” - this we have with the “Offset Edges” add-on, so this should be included as well. I also like the ability to select two vertices and join them with an edge, I am not sure if Blender can do this easily, I know we can select two unconnected edge strings and make a face of them, but this is not quite the same thing…

While I am on a flow here, could we also add the ability to create shapes within shapes as holes without having to add a least two edges from inside loop to outside loop, thus creating two Ngons that don’t have holes…

I think that basic, efficient draughting techniques have been lost in not only 3D modelling packages like Blender, but also many CAD packages, the old ways were not always the best, but they certainly had a lot of merit. Systems in the 1980’s had to be very efficient and fast to compete with a good draughtsman and had to run on computer systems that were toys (think VAX PDP 11’s) compared with today’s machines.

Let me know if anyone agrees with me, I am more than willing to expand these ideas, if they are thought relevant still, otherwise I can always enjoy my retirement!

Cheers, Clock.

12 Likes

Oh, I forgot this one:

I would call this “Extend/Trim to Intersection” - select the two edges in the set and the system puts the intersecting vertex in place then trims/extends the edges to this point. I have shown three possible scenarios of this requirement.

Cheers, Clock.

7 Likes

OK just a quick test to see how easy this intersection lark is going to be:

I am on holiday with only my wife’s MacAir, so only have access to Blender 2.79. I made an object with several edges, to test it worked on selected edges only. You can see the new vertex at the intersection point. This is the code in a simple Animation Nodes Script node:

import bpy
import bmesh
import numpy as np
mesh = obj.data
verts = mesh.vertices
edges = [e for e in obj.data.edges if e.select]
lv1 = edges[0].vertices
lv2 = edges[1].vertices
# Working in X-Z plane
a1 = (round(verts[lv1[0]].co[0],4),round(verts[lv1[0]].co[2],4))
# Get Y value
yV = round(verts[lv1[0]].co[1],4)
a2 = (round(verts[lv1[1]].co[0],4),round(verts[lv1[1]].co[2],4))
b1 = (round(verts[lv2[0]].co[0],4),round(verts[lv2[0]].co[2],4))
b2 = (round(verts[lv2[1]].co[0],4),round(verts[lv2[1]].co[2],4))
# Get Intersection
s = np.vstack([a1,a2,b1,b2])
h = np.hstack((s, np.ones((4, 1))))
l1 = np.cross(h[0], h[1])
l2 = np.cross(h[2], h[3])
x, y, z = np.cross(l1, l2)
if z == 0:
    # Parallel Lines
    int = (float('inf'), float('inf'))
    return
int =  (x/z, yV, y/z)
# Create Intersection Vertex
bm = bmesh.new()
bm.from_mesh(mesh)
bpy.ops.object.mode_set(mode='OBJECT')
bm.verts.new(int)
bm.to_mesh(mesh)
bm.free()
bpy.ops.object.mode_set(mode='EDIT')

There is no “Stupid User” testing in there, like making sure the edges are co-planar, but I can always do this later when I get home, or leave it to the experts… I guess next I will need to move the nearest vertices to the intersection, or simply delete them and re-define the edges. Further development on holiday will be curtailed now as it is “Gin & Tonic” O’Clock. :cocktail:

Cheers, Clock. :stuck_out_tongue_winking_eye:

EDIT:

It seems I cannot post any more replies until someone replies to me (new user), so here is another function:

Merde! I can only post one image in a reply here, so you will have to wait to see the picture… Thousands of posts on Blender Artists, but not trusted here yet…

In this one I have moved the square end a set distance along the angle of the centre section, i.e. expanded the object along its centre section axis, which lies at approx 13.24052 degrees to the horizontal. Try doing that with native Blender in 2.5 milliseconds!

When I get home I will make a “CAD Functions” node to do these functions, using Exec buttons. The maths behind them so far is pretty easy, if you know your numpy, geometry, etc principles. Perhaps, if you would like to reply here with other functions required, I can make a CAD Node and release this on my GitHub.

As you will see from this link, my work has been with MIDI, Sound, DAW functions mainly and some other useful bits for Animation Nodes. I see no reason why this cannot just be a AN CAD sub-section to start with, then maybe it can be included in Blender, or Everything Nodes, at some later stage, if there is sufficient interest.

I am still keen to explore the possibility of adding extra key-ins to vertex placement/extrusion, like an Absolute XYZ, or Delta-Coordinate, or Delta Distance-Angle.

I shall await responses!

4 Likes

I haven’t dug deep enough into the codebase to layout a concrete plan, but I think that, if we can separate transform orientations and alignment orientations under the hood, we can expand the existing snap system to cover a lot of “snap-to/align-to projected intersection” scenarios we’ve seen in this thread.

Some of the other things you mention, like transforming from an offset position and extruding at a relative angle, could (theoretically) be implemented with gizmos and the active tool system. You can abuse them as pseudo-modals to take data from selections and create transformation matrices at relative angles.

5 Likes

@ThatAsherGuy Yes, I agree, we can already key such things as X, XX, R, S, etc. so I don’t see a great deal of work in adding some more options to the module that allows the existing key-ins for duplicating objects, extruding vertices, etc. Like you, I have not looked “under the hood” to see how these are implemented. It would also be good to get ideas from more users who have used draughting techniques in their occupations.

At the moment, if you want to duplicate an object, or extrude a vertex (including multiples thereof) in multiple axes (1 in X, 2 in Y, 3 in Z), the process is like this:

  1. Select Object(s)
  2. Key SHIFT+D
  3. Key X 1
  4. Key G Y 2
  5. Key G Z 3

Or, you could place the cursor at the required location for a single object then key SHIFT+S => “Selection to Cursor”, but this only works for one object. You could also type in the transform boxes - say click in the X Transform box, Right Arrow to end of existing entry, key +1 and Return. Repeat this for Y and Z boxes for each object if many are to be processed, this is all time consuming. Example below:

27

With what I am proposing the process is this:

  1. Select Object(s)
  2. Key SHIFT+D
  3. Key DC 1,2,3

For duplicating along a slanted vector (3m at 30 degrees anti-clockwise in front view), the process is this, only works on one object BTW:

  1. Select Object
  2. Key SHIFT+D
  3. Key X 3
  4. Place Cursor at original object origin
  5. Set 3D Cursor Mode
  6. Key R -30
  7. Set Cursor to new object origin
  8. Key R 30
  9. Apply rotation to duplicated object

With what I am proposing the process is this, works on many objects as well:

  1. Select Object(s)
  2. Key SHIFT+D
  3. Key DR 3,-30

I would use basic Trigonometry to alter the coordinates of the duplicated object, so for the X delta use [existing X]+(3*cos(30*pi/180)) and for the Z vector use [existing Z]+(3*sin(30*pi/180)). Note I am converting the angle in Degrees to Radians, the maths is not complex for these DC and DR functions. I would also add an XY function to move an object, or vertex to a known absolute, e.g.:

  1. Select Object
  2. Key SHIFT+D
  3. Key XY 1,2,3

For manipulating vertices, either to duplicate, or move, or extrude them, I would propose using the same principles, hoping that the same module for transforms is used…

I am quite happy to work with the devs in specifying such a modification to the “Transforms” module. Is there much support for these CAD functions, bearing in mind the advances in 3D printing from Blender and the pricing structure for many CAD packages? I just want to make the draughting processes much easier and more capable.

PS. Here is my image from my previous post, now that I am a trusted user:

26

This shows the original object at the bottom and the modified one at the top. This is the code in the script to do this:

import bpy
from math import sin, cos, pi
verts = [v for v in obj.data.vertices if v.select]
if len(verts) > 0:
    for v in verts:
        v.co[0] = v.co[0]+(offset * cos(ang*pi/180))
        v.co[2] = v.co[2]+(offset * sin(ang*pi/180))

The code only works in X & Z axes, but would be easy to adapt to any axis combination and would need mods to work in 2.8, but you should see the principles.

3 Likes

One more thought on this:

I just did a quick Internet search for AutoCAD pricing in the UK - £1500 + VAT per annum, or £4050 + VAT for 3 years, Bentley MicroStation - £250 per month per user. Hmmmmm how about making Blender more attractive to CAD background users…

In 2.8 you can rotate the 3D cursor, which cuts this process down significantly. When you combine that feature with using the 3D cursor as a pivot point (which lets you control the offset distance when snapping), you can speed up a variety of workflows.

4 Likes

So, after about 4 hours work and some previous research I made this AN node:

What does it do? Answers below:

  1. Set the mode to which plane you want to work in; X-Y, X-Z & Y-Z.
  2. Calculates the precise angle subtended by two vertices.
  3. Extends/Trims two non-parallel edges to their intersection point.
  4. Draws a vertex at the intersection point of two non-parallel edges, without altering the edges.
  5. Moves the selected Faces/Edges/Vertices by a given delta offset in three axes simultaneously.
  6. Moves the selected Faces/Edges/Vertices to a known absolute XYZ coordinate, removing all doubles.
  7. Moves selected Faces/Edges/Vertices by a given delta distance at a given angle.

You can use the Angle function to set the given angle for a move by selecting two vertices, centre first, then offset - these need not be an edge. You can move all selected geometry by a delta amount in all three axes as one operation, good for altering a mesh at an awkward angle. You can move selected vertices to one given XYZ location, this makes them all coincident, then removes the doubles.

You can either trim two edges to their intersection, or place a new vertex at that location, this is good for finding convergence points to make new geometry, or to intersect a line to a circle for example. All action require you to simply select some geometry and then just click the appropriate button.

I will think on for more options, like extruding geometry by the same operations rather than just moving it, but here is a good start for CAD type functions to make drawing geometry easier, much quicker and more “CAD Friendly”. It would be nice to see these in standard Blender, but this is a start. I have added quite a lot of error trapping, but some more might be required.

Any feedback would be gratefully received!

Cheers, Clock. :grin:

EDIT:

I have just built the Extrude functions, so you can use Deltas, Absolutes, or Delta + Angle to extruded a vertex:

42

That lets me chase a vertex around a path very quickly to form parts.

EDIT:

Like this one where the hole is exactly at the intersection of the two sloped faces on the left side:

11

10 Likes

This option on my CAD Node moves the Cursor to the midpoint between two selected vertices:

This option my CAD Node moves the cursor to the intersect point of two edges:

I’ll work on the “Perpendicular To” option later.

Cheers, Clock. :cocktail:

9 Likes