Rhino WIP Feature: Constraints

Constraints are a surprising addition.
The (folks who make Solidworks )aren’t going to like that. : )

Edit: might have been misread.

1 Like

Good point on assemblies. Yet, I want to use this for urban design as well. In that case, I would split up sketches by area, subarea (for several juxtaposed design iterations) and eventually by building. In that case, it would be tedious for me to enable/ disable the road lines for each sketch individually. I may have different road designs that determine the shape of the building. So each of the building sketches could have a layer called “Road design” and to present my final design, I would want to toggle them all on/ off simultaneously.

In that case, I would project/ include whatever parts of the existing road network into the design sketches where they would interconnect. So they would be driven by a master layer that is either part of a master sketch or a bunch of sketches — this all depends on how performant the solver is. In Fusion 360, when I tried this, I had to split things up. But it became very difficult to manage as I couldn’t differentiate between building outlines, road outlines and road centrelines (these are essentially construction lines), etc.

Layers, to me, really are more about visibility and presentation than they are about the constraints applied to them. If you limit layers to being object specific, you’ll lose a lot of flexibility. And you’ll lose the workflow I outlined earlier.
Instead, I would advocate for the more open approach, where users are responsible for how they want to manage their layers. In an assembly context, you would probably have a common base layer name and a different, per part/ component suffix attached at the end. But, you would also be working in the layer tree more often with every object being on its own host layer with nested layers for all bodies, annotation, sketches, etc. To ease that work, there could be an autocomplete for creating layer names with sketches (just like Grasshopper makes suggestions based on what you type). There could then be a filter to autocomplete based on layers within the document or based on the parent layer only (the component name).

2 Likes

It might be an interesting developer excercise to intersect Snapshots with Constraints sketches to see what happens in that type of scenario, at least as a sandbox excercise.

Yes, not being able to create constraints between curves of different/separate sketches is how I would expect it to be have.
Global parameters could change constraints referring to that parameter.

The way I use parameters is to drive one or more contraints of the same type (e.g. distance constraint) that should have the same value. Normally I only use parameters linked to constraints for those things that need to be modified either at the component/block level or at an individual instance level (i.e. to override the “default value” that is within the component/block definition) if there are one or two instances that need to be slightly different for a particular purpose but do not really warrant another block definition because it is specific to only that model. Or when in a hurry during prototyping to Include a very very last minute change before presenting for review.
All other constraints are basically “fixed” value or ratio constraints (e.g. if one value has to be the double of another value).

In the case predefined parameter values that have overrides at an instance level it would be nice if there will be a “revert/reset to default”/“clear overrides” or how one would like to name it that would reset all (selected) parameters with an override back to the values as originally defined in the component/block definition.

The reset should preferably also happen when replacing a component/block with a new component/block because the overrides would then usually no longer be relevant. Whether this should be default or optional (e.g. ask during replace if parameter overrides need to be reset or have this done as default, definable in Rhino settings). I haven’t used constraints/parameters a lot yet to have tested for this, so it could be that it is already being considered/implemented. If not then please consider this as a feature request.

1 Like

Agreed, I too use layers either for visibility of for creating structure within the model, e.g. certain types of objects are on a specific layer, e.g. walls, windows, bolts, areas or whatever the needs are.

In my opinion it would be a very bad implementation if layers could be restricted to a particular/single object only, that defeats the purpose of layers. If such a restriction would be necessary then it should be upon the user to pay attention to use a specific layer for only a specific object.

1 Like

That’s half of the story. You shouldn’t be able to create constraints between different sketches, however, you should be able to include sketch items from another sketch into the current sketch. This is necessary to simplify subsequent derivative sketches.
Say I have a main sketch that is creates the outlines of a house. I would extrude this sketch and then create a new sketch that serves to create the facade. For that, I would need to reference the edges of the extrusion into the current sketch. This means, that this second derivative sketch references geometry that was based on the first sketch. If I edit sketch 1, the windows that are part of Sketch 2 move according to the new edges of the facade, because the reference to the extrusion edge is updated.

Or more simply, I should be able to reference geometry from sketch 1 in sketch 2 through a dedicated reference (include) command. See:

1 Like

Thanks for the clarification, I now understand what you want and yes that may be useful to have.
One concern that I have with this is that nesting like this makes the file more computational intensive and may slow down Rhino quite a bit if it is used a lot in a file, but I guess that may also depend on how it may be implemented by McNeel if they do introduce it to Rhino.

1 Like

It works fine this way in Fusion 360. But, you will need to be cautious. It’s better to reference sketch points than it is to work based-off extrusion edges (as in my example), because it doesn’t require Rhino to compute the extrusion beforehand. Being computational heavy can only become a concern once implemented imo, also note that with Grasshopper, no-one complains about it being computationally heavy. It’s an opportunity.

Hi @Joshua_Kennedy,

I am now testing the Constraints feature in a project and have another few items to add to your list. The project is now starting to become useable to me, which is nice. Actually, the layers are working as I would want them to, so I spoke too soon. It’s actually exactly the way I would hope it to be. I responded based on the videos earlier.

  1. I would only like to see an icon added to a layerspanel to know that it contains sketch items. :slight_smile:

  2. One thing immediately strikes me, which is that there is no dedicated in sketch editing environment. I would personally prefer to go ‘into’ a sketch by double clicking one of the sketch elements. Just like with blocks. The reason being is that if I do a lot of drafting, I don’t want to add items to a sketch manually afterwards. I would like to do the sketching and have the curves automatically added to the active sketch.

  3. If you are concerned about snapping to existing geometry outside the sketch, there could be a toggle for that in the constraints panel.

  4. The next step is to add project/ include so you can reference geometry that is outside the sketch inside the sketch. This referenced geometry is always fully constrained. However, it can be moved by moving the original source geometry.

  5. And the third step would be the option to automatically project/ include any points to which you snap and to set the relations according to the snap conditions that apply to both the curve and to the snapped point (e.g. line = tangent, point = coincident OR line = horizontal, point = coincident). When turned off, you can still work as is the way you do now and snap wherever, add constraints later manually. With the automatically project/ include, it makes it easier to create sketch upon sketch and that’s the way Fusion 360 works for its entire parametric sketcher.

  6. Finally, I would like to see an option to anchor an entire curve. I don’t want to do this point by point. Taking in 3. , 4. and 5. , I may want to just copy and past a road outline and then anchor it in place to use it as reference line for other sketch curves without it being driven. This would already be very valuable and high on my wish list for current workflows. If I would then need to modify this line, I would remove one or two of the anchor points (out of a dozen + automatically anchored ones) and save a lot of time.
    I would definitely use a DupToSketch command, which would duplicate a curve and add it to the sketch. Then add a macro to lock this curve on all points in a single operation.

As for other things:

  1. If I split a sketch line with another sketch line, all of the Anchor constraints are removed. If I uncheck removing the constraints, the line is removed from the sketch.
  2. There is no “ConstraintsRemoveObjects” in case you want to remove a sketch item from the sketch and bring it back to the layer it belongs to. I cannot explode a single segment line, so that doesn’t help in removing the item either. Not that it should. Maybe there should also be an easy way to convert the entire sketch back to non-sketch geometry.
  3. A big quality of life improvement would be that if I add a constraint to a non-sketch curve, that this curve is added to the sketch. This should be an optional toggle in the Constraints panel, so you can avoid accidents if you know you don’t want this to happen (e.g. with lines close to each other).
  4. For applying constraints, would it be possible to skip the curve selection step? I feel like this click is really reduntant. And if you need this additional step of specifying the curve that you want to constrain, you should do preselection.
  5. With other line-types, the halo should also adopt the new linetype, otherwise it looks a bit odd:
  6. If I select a constraint from the panel, I can’t use Zoom to Selected to zoom into the constrained point. If I select the constraint from the canvas, I can Zoom into this point. So could that also be added for the constraints panel?
  7. Could there be a single click mode for the Anchor constraint? Basically this should omit the second step of setting a position to anchor to and use the current position as anchor point.
  8. Isolating a sketch line hides the constraints applied to it.
1 Like

Question, how do should I be adding the constraints to make it possible to move the bottom line horizontally?


I can’t get an angle constraint to fix this vertical line, nor can I add a length constraint to the bottom horizontal to drive it.
Constraints test.3dm (140.1 KB)

It appears that I am missing something when I try to apply what I know from Fusion 360.

Hi,

You need to update the anchor point instead of dragging the line.

AnchorPointMove

Is your expectation that the anchor point moves with the curve? We’ve been back and forth internally on how this should behave.

The anchor widget may also be useful here since you can move it with the gumball.

P.S. It’d be very interesting to see your model when you’ve finished working on it

1 Like

Hi, thanks for the help.
How I expect it to work is that I can anchor a line as well (basically locking it for the sketch solver). That’s what I thought anchoring does initially. But it now works as a fix for points, which is fine. If I were to anchor a line, it should show as being locked in its halo, that is easier to distinguish from the lock icons in my opinion (e.g. a green outline as in Fusion 360).

I demonstrate the expected behaviour here manually (this is how it works in Fusion 360):


This way, you need few constraints to already be able to make useful changes.

I do expect the endpoints to move in this case.
I would actually expect that when I drag a line, it retains it’s direction if there is no constraint applied that would state otherwise. So dragging the line would mean moving it with orthomode on, basically.
I set the lines to the locked layer to indicate they are locked, saves a lot of lock icons. The one at the bottom shouldn’t actually be there either imo.

I would also expect that when I want to lock a line, I activate the constraint, click the line and the entire line is locked, no space to confirm. Clicking a line again unlocks it.

Can offset constraints also show a dimension line? That makes laying out appartments in buildings much easier to do.

2 Likes

I added a MidPointConstraint command that should be available in the next WIP. It creates a point along curve constraint with the curve parameter set to 0.5. It removes the extra step of specifying the parameter. That way you can go back and tweak the value later if you want something more general than mid point. The issue is logged here.

4 Likes

If you just hit enter and input nothing at that step it will use the current position.

1 Like

Good to know, thanks. I do hope you’ll be able to reduce the number of inputs required by the user (either clicks or spacebar taps). It still is quite a laborious thing to anchor geometry. And unfortunately, it has put me off from finishing my model > I went over to Fusion to do it quick and dirty. :frowning:

E: I will of course try it again when it is a bit more mature, looking forward to the progress :slight_smile:

1 Like

Funny, that’s a workaround I use in a different very expensive CAD package right now.

But, it’s important that the MidPointConstraint has its own icon, so it’s easy to correctly read the entire sketch at a glance. Perhaps anytime you set any point along curve constraint to 0.5 it could change symbols?

3 Likes

@Joshua_Kennedy ,

Looking forward to play around with this one :stuck_out_tongue_winking_eye:

One more thing, I’m sorry if it’s already mentioned I did not read all replies.

Is it possible to make the constrained model “Immune” to Explode command, thus making a constrained solid that you are unable to modify sub-elements?

RH-70516 Constraints: Added MidPointConstraint command

is fixed in the latest WIP.

If you explode constrained curves the constraints should update so they reference the new exploded geometry. I also made this work so the constraints are updated when the Join command is run. The issue is here.

3 Likes