Rhino WIP Feature: Constraints

Hi -

Yes, you should expect these files to break - the development of this feature is still in the early stages and necessary changes to the plumbing will make older files not work.
-wim

Will the sample files be updated for a later/the latest Rhino WIP when necessary so that people can still have a look and try the constraints as implemented in Rhino?
I assume they will work the same or at least very similar to how it works in other software but there might be (small) implementation differences that could generate comments for improvement or change.

@wim I noticed that when copying/duplicating an object with constraints, the copied/duplicated object has no constraints.Will future updates allow for creating a copy of an object to include the same constraints as in the original object?

1 Like

Hi Art -

Thanks, that feature request is on the list as RH-66905 and I’ve added your request for this.

As for updating the samples, I suppose it’d be more meaningful if users try their own stuff and provide feedback based on that - as you just did.
-wim

1 Like

i totally agree that variables and formulas are essential. a must.

i think @mattytraxx 's input on the UI is great - values next to constraints list.
i love the idea that different types of constraints show in different font/color/bold/… see discussion above

2 Likes

First off all, these features are perhaps the most exciting ones I have seen in any CAD software this year, GH2 + constrained sketches are a dream.

  1. In Fusion 360 and Inventor, you can favorite certain parameters, so they are added to a separate list of constraints. It may make sense to add referenced constraints/ parameters in a separate lists as well. A header should separate them in the panel. These favorite constraints have a star symbol in front, which, if selected, is coloured. That also helps visualise the few constraints that drive the entire model.

  2. These programs organise their constraints like an excel sheet with multiple columns. The first column is the parameter name, the second a formula (could be a referenced constraint as well) and the third being the actual value. That way, you can also see which constraint is driven by something or that it is just a stand-alone value. This ties into @mattytraxx post: Rhino WIP Feature: Constraints - #36 by mattytraxx. The idea behind separating value and parameter is, alongside visual clarity, that, when a dimension is driven by another dimension, this gets shown as part of the formula (i.e. “D4_Height”). The value box is where the user sets a value for a dimension.

  3. Typing in “Height = 4m” should create a constraint with the name height and value 4m. Typing in “Height = Length-Width” creates a formula for the Height parameter, which references “Length” and “Width”. Typing in “Height = D1-D17” should do the same. In the latter case, clicking on the associated dimension inputs D1 or D17.

  4. In Fusion and Inventor, there is an autonamed D[#] name associated to a parameter (to get the D1 and D17 value). I’m not sure you actually need it in Rhino, instead, you could reference the parameter name immediately. Although being able to type in a D17 instead of a long constraint name is useful. Then again, there could also be an autocomplete like you have when coding (a dropdown appears, Arrow down + Enter to choose a constraint, or click on one of the entries.

  5. The formula editor, which is required for 3., should also support if statements and other logical statements.

  6. Also, an option to alphabetically sort parameters by name, creation time (from first to last and vice versa. The latter should probably be the default for non-formula, driven constraints, whereas the former should be the default for dimensions with formula and/ or checked as favourite.

  7. Ideally, I would want to select lines and convert them to a sketch. Then, you would be able to differentiate between sketches and ‘regular’ curves and lines. Hover over a sketch should show the sketch’s bounding box. Double click the sketch to enter the editing environment of the sketch would seem reasonable to me.

  8. Having the sketch function like a block (container) also has the benefit that you can move the sketch to a different plane or face. Simply right click the sketch > redefine base plane. For planes the sketch should be oriented to the plane’s origin and directed to the normal of the plane. If a face is chosen as baseplane, the user should supply a point for the origin.

  9. Commands to easily add/ remove lines and curves from sketches, incl. construction geometry. Add means, including a new item from the canvas in the container, Remove means, excluding an item from the container and bring it back to the canvas.

  10. In that case, exploding should delete the constraints and bring the sketch back to the canvas. RH-67788. This is also how exploding works with blocks. If the sketch should remain constrained, the user should use a different command which creates a new sketch from selected elements. This command should keep the constraints.

  11. Projected lines should also be constrained and be a separate geometry type (usually purple). You can project lines, points and faces (which converts the outlines to curves) from other sketches. The idea behind this is that you can have sketches reference each other. For an extrusion, you may want to use the bottom extrusion profile to drive the top profile ( to create an offset, which is used as sketch that will be used to carve out the inside of the extrusion).

  12. Projected sketches are always fully constrained and can only be altered by editing the original sketch. This way, sketches can be simplified by referencing in some elements and avoid having to add all the construction geometry again.

  13. An option to auto-constrain lines that were added to the sketch, i.e. if I add an ellipse or rectangle from the canvas, it would be useful to let Rhino add constraints to the curves if I ask it to. Big time saving feature.

  14. In Fusion 360, there is colour coding for: unconstrained geometry (blue), constrained geometry, fully constrained sketches (black). Again, this needs a bit of differentiation from regular geometry.

  15. In Fusion and Inventor, sketches are also shown with a fill, because this indicates that the shape is closed and can thus be used as an extrusion profile.

  16. For those familiar with the shapebuilder tool from Illustrator, using an equivalent tool to boolean filled curves by dragging over adjacent regions to unite, subtract, etc. (clicking on individual regions should also work) and modifiers to determine whether to unite, subtract, etc. while retaining constraints would be a long term wish.

  17. I would also love to have icons all over the place. Any constraint with an angle or length, should have a dimension widget, double click on the dimension to edit the value and update the line. Without these, it is difficult to see how the sketch is driven.

  18. When editing a dimension, you should be able to click on another dimension to reference that particular dimension constraint.

  19. For curves (including 3d curves), G1, G2 and G3 should also be given a distinct icon. Maybe the “Match” and “BlendCrv” commands should automatically apply these constraints when invoked within the sketch context. This is another reason why there should be a dedicated sketch environment.

  20. Usually, snaps should automatically assign constraints (snap perpendicular = perpendicular constraint, snap nearest = coincident constraint, snap intersect = co-linear constraint applied to the sketch point that made use of Smart track).

  21. For mirror, Fusion 360 has mirror constraints incl. icons. History doesn’t work well enough for this imo, because it lack the visual clue of it being a driven copy. These features should all be using constraints and should definitely not be a mixed bag between various commands. When changing dimension of a sketch, you need to be able to predict how it will change, this is crucial for how it is used! But, industry standards can be broken, a mirrored sketch could also be displayed as a grey line style (so no icon). Hovering over the mirrored curves should show they are associated to the original.

  22. UI wise, the icons could use some shading of some sort, something that visually distinguishes them as being a widget/ HUD, re-using existing annotation objects should be avoided IMO for the sake of clarity. The text could be underscored and bold and could possibly be placed on a background object, such as a slightly filleted rectangle with a ‘shaded’ gradient. That indicates that it is a UI element, like a toolbar is separated from the canvas.

  23. There should be a constraints toolbar to pick from the various options. Since Match, BlendCrv and Mirror are likely to be associated to constraints, they may need to be in there as well. They are all constraining the geometry.

  24. Hopefully, also this: https://mcneel.myjetbrains.com/youtrack/issue/RH-3534 (spoiler, more shortcut options for Rhino).

  25. The ability to set dimension constraint values through Grasshopper, this allows for optimising the form with Galapagos, amongst others.

  26. As mentioned by others, construction geometry should be displayed with the centreline geometry type. Unconstrained, constrained and fully constrained should be a solid line and have other differentiation. This conforms to the conventions set by other parametric software packages.

  27. image
    You should be able to navigate this menu with the keyboard, so C, then H should select the horizontal constraint.

  28. I would prefer the rightclick constraint menu to be accessible with a keypress as well. As an arbitrary example: C + Spacebar for the menu C, then H for the constraint. This is how Blender uses these pop-up windows and it extremely fast if you know the sequence. Also, this would add new options to use sequences that are otherwise used by aliases. New sequence options means, shorter sequences and therefore time spent more efficient.

Parametric modeling (long term goal)

A. Do you consider a parametric timeline and captured history for all commands? I.e. an extrusion has a depth parameter that could also become a constraint in 3d space (or rather a parameter). That would be the final step towards full parametric capabilities. Similarly a loft has G0/1/2/3 values for constrained edges/ lines. Ideally, it would be possible to add/ remove curves at a later stage during the process by double clicking on the timeline icon. Or by using something similar to Query Edit in Alias: [History] - Feature requests: query edit & history visualiser
Hopefully, it is only a little more work to visualise history in the UI, the icons are already there for commands, as are the parameters for a lot of commands. They just aren’t exposed to the user in the UI yet.

B. Blocks to contain multiple sketches and the associated geometry (bodies)

C. Parametric workplanes with a widget to move them (custom gumball)
The advantage thereof is that these planes can move sketches around and thereby change the geometry. I would then love them to be part of the new layers panel as a built-in category (just like the aforementioned bodies/ closed polysurfaces and regular surfaces). This could then constitute a model tree with hierarchies and use the lightbulb to show/ hide individual geometry or workplanes. While the named CPlane has some of this functionality, it is yet another panel that should be opened, whereas I prefer there to be more HUD functionality with widgets for planes in the viewport. Consolidating all in a layers panel would help to create a complete overview of the parametric relationships.

D. Assemblies (blocks) with joints

E: Added a couple new items.

6 Likes

@Joshua_Kennedy are you the only McNeel developer working on this feature?

It seems like it’s growing in popularity and is becoming a lot to handle.

Dan

I noticed your anchor point and line that is anchored are disjoint. When you manipulate the control point the sketch will not be able to find a solution. This obviously isn’t being communicated clearly. I’m hoping to fix that with RH-68300.

Are you expecting the anchor to move with the control point? I suppose there could be a better indication drawn in the view to show you where the curve is anchored.

1 Like

I hear ya about the mixed bag approach…the thought to use Mirror + history was worth exploring to see if existing Rhino features could be leveraged to save development effort. It would be ideal if a new MirrorConstraint (or similar) command were added.

2 Likes

First off thanks for the feedback. This is all fantastic. I’ve been a bit swamped lately so sorry I didn’t get back to you sooner.

I recently implemented a suggestion from @mattytraxx about separating the various constraints into those with and without parameters. Is this at least partially what you were looking for?


We still have a lot to figure out with variables and formulas. I updated RH-68451 with your suggestions so we can better make these decisions.

I’ll add this suggestion to RH-66901

The ConstraintsSketchAddObjects will add geometry to a sketch. Similarly unconstrained geometry can be removed from a sketch in the panel with the red X icon.

I added you request to RH-67960

I opened RH-6855 for this.

I added a comment to RH-67791. I’m hoping to get to it soon.

This is on the way and logged as RH-67661.

I added a note to RH-68034

This has been considered

3 Likes

This is actually where my head is at currently. I was able to create two orthogonal constrained lines as inputs for a history enabled surface. This surface acts as the mirroring plane. Then from there I can use history to mirror the constrained curves across it.


Chair.3dm (615.0 KB)

I will look into this as well as a mirror constraint to figure out which makes the most sense.

21 Likes

This video looks very promising!
Now if the whole rig would sit inside a block, and have those parameters that you edit in the video exposed - voilá! Dynamic blocks!

8 Likes

I was playing around with your chair sketch, and it took me some time to understand which constraint is applied to which element. Would there be a way to identify objects and constraints more easily ? Some display toggled when one line is selected on the panel ?
Also, shouldn’t the PointOnLine constraint be considered as a constraint with parameter ?

2 Likes

yes and additionally I would like to have a coincident constraint without parameter as well. I think in most cases I just want to make sure one end of a curve stays on another curve and then specify the rest with dimensions.

2 Likes

Yes, we’ve discussed this before and it needs done. It’s logged as RH-68037.

Yes, that’s correct. I logged it as RH-68553.

1 Like

That makes sense. I opened RH-68554 for it. As this develops further we can figure out how best to combine constraints so there aren’t so many to shuffle through.

3 Likes

That would be a nice thing to have!

Even though I like this idea, the first thing that comes to my mind is how tricky and frustrating can be setting up e.g. Door family in Revit, which solves geometry based on some constraints. Sometimes a lot of constraints, and often not very intuitive, need to be made. Also, if something doesn’t work as expected there is no clear procedure to look at and debug (contrary to the geometry created by Grasshopper). But probably Revit is a poor example and other mechanical software does it way better.

Constraints are great because they offer a quick start and the ability to directly manipulate geometry in the viewport, especially when we have widgets.

What I would like to see is how we could merge the best things from different worlds.

In short:

  • Great viewport input widgets (and customizable panel input)
  • Solid, predictable, easy to debug Grasshopper definition (solver)
  • Some kind of wrapper to make it an independent object (VA GH Style, Smart Block – you name it)

I wonder if such Smart Object could consist of both: Constrains and Grasshopper. For solving 1st step would be constrained geometry manipulation, 2nd step is Grasshopper on top of it.

Another idea is if Grasshopper could create/populate constrained geometry.


@enric I’m jealous of these input widgets and would love to have them inside VA Objects.

1 Like

Thanks Joshua for logging my requests!

So, this means there won’t be a command to remove selected items from a sketch that does not involve the cross button in the panel? If I were to select a bunch of curves in the viewport, would I be able to remove them from a sketch with the button (basically propagating viewport selection to the sketch entities in the panel) or not?

I am eager to test the constraints feature in the immediate future when the widgets are ready. What would happen if I were to open the file in Rhino 7? Will they just be unconstrained curves or should I expect there to be a loss of geometry (incompatibility)?

E: The video looks very promising!

Do any parametric modellers have forward and backward compatibility between versions?

If constraints are going to mess with compatibility between versions then that could be a problem.

No, I was just trying to let you know there is currently a solution. I opened RH-68561 to add a corresponding command.

I don’t anticipate this losing the geometry. As of right now if you save a constrained model from the WIP for Rhino 7 the geometry stays, but of course there are no constraints in Rhino 7.

3 Likes