Rhino WIP Feature: Constraints

Thanks for reporting this. I notice the constraints resolve the next time the solver runs. Do you remember how you ended up in this situation?

Screen Shot 2022-04-27 at 9.21.44 AM

Is that barely visible white fuzziness what you mean by “halo”, or is it an artifact of low-quality discourse display? If it is what you mean, I would suggest a slightly more aggressive appearance - not much, but more. Or something else even better.

Are the two dots before and after the dimension digits the user’s clue that the dimension is for an adjustable constraint? Not very effective IMHO. Also: how does the user know that it can be double clicked to adjust it?

Is there any reason why you can’t delineate the constraint characteristic by simply displaying the dimension with the edit box already exposed and requiring only a single click (or even no click at all, just a mouseover) to edit the value? It would be much easier to visually pick out the adjustable constraint dimensions from the rest and much more obvious that the value can be edited.

I’m imagining that with a mouseover the edit box background could change color to indicate that typing is acceptable. Whether this would be ergonomically practical is open to question given the possibility of mouse “accidents” while typing: If the mouseover locks the edit status until an enter is received things could get complicated if the user wants to escape without changing anything. If it’s editable only with the mouse over the box then bumping the mouse would interrupt the typing and possibly leave the constraint with nonsense for redisplay. This is just a bit of thinking “out loud” in the hope you’ll come up with something really nice. I know it’s not easy, but you do seem to be giving it the detailed thought it requires.

try to move edit point of the line in vertical dir

Looks great!

What I’m seeing is a cyan highlight on both sides of the curve. The curve thickness is also increased. The combined effect is very pronounced in the WIP as well as in the image here on Discourse. I’m not seeing the white fuzziness.

Absolutely. A mirror operation in a constraint-based sketch environment requires a mirror line which is itself constrained and history would have to remember this line and update if it moved. Do you think it would be necessary to add a new option to the Mirror command such as Line? Since the Mirror command requires a plane (not just a 2D line from the sketch), perhaps the mirror plane could be implicitly defined to be orthogonal to the CPlane of the current viewport.

The mirror line is construction geometry, which I discussed in my previous post, but it occurs to me now that we can already create construction geometry in Rhino today by placing curves on a separate layer.

1 Like

I was browsing this thread and saw some alarming posts from some users that was re-inventing the wheel or treading through very familiar tracks… now, I don’t mean to step on anyone’s toes, but is this being designed by people only used to Rhino or is design input being considered from people well versed in different CAD packages? I know it’s a sensitive issue to (publicly) look at what others are doing, especially if those others are huge, well established, deep pocketed and historically litigious corporations, but this is a well established field and the problems here have been pretty much solved for decades.

I’m just curious, because Siemens recently tried to be “revolutionary” with a new sketch solver paradigm for NX which backfired spectacularly because it seems they had a very innovative idea, but never asked their users if it was any good (and so far, it’s very much the opposite). :slightly_smiling_face:

(EDIT: And speaking of solved problems, someone recently did this for Blender! Pretty incredible what people do for free with free software.)

3 Likes

In opening the sample files I get an error message. Running (8.0.22116.12305, 2022-04-26)
image

Same error message here with latest Rhino 8 WIP

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