I have a model i am trying to create in grasshopper. Originally i was able to create this in solidworks utilizing relationships between curves, but I am unsure how to do this in grasshopper. I am still pretty new to grasshopper, so apologies for anything that would be obvious to a more experienced user.
The model consists of 4 sets of curves. The object is symmetrical in two directions. I am provided with 2 radius dimensions, a length, and a width dimension. To make the object fully defined all curves need to be tangent to each other.
Everything I have been able to find when searching online about curves is that the points need to be established. While I can establish the points for the furthest the model is left, right, up, and down, the location of the 4 points that are created from the intersections of the curves are not known. Their location only becomes known after establishing the tangency between curves.
These threads end up with very generalised solutions which may be overkill for you, but this one on the old forums looks neat and tidy and exactly matches your problem.
Desribed like that it seems you have 4 numbers, but instead you can only have 3:
radius, radius and width.
Height will be a consequence, you can’t directly control that.
You are correct, I am given that dimension, but it over-constrains the model. Thanks for catching that, its been a while since I’ve tried to tackle this again.
What do you mean? Putting the same values must result in the same shape.
Surely the Rhino/GH version is accurate… parametric/constraint version might instead converge in something with small infinitesimal error.
That’s a new and different task. What do you mean with that?
Of course.
I expect the “hard-coded” programmed one (grasshopper or c#/python) to use many order of magnitude less power (computing time) than the parametric one.
Programmed one is “one-shot” it works or it doesn’t.
Parametric/constraint usually pin-point iteratively to find the solution.
That’s a huge difference.
With the hard-coded version you can calculate hundreds of similar sections real-time … I expect to perceive lag if you manage to do the same with parametric software.
Unfortunately it doesn’t create the shape i am looking for. The shape is in the image i posted originally. When entering the values i get either this shape
If I use 4 circles in solidworks to replicate the gh definition, this is what it would end up looking like. Then i would trim away the curve sections that I don’t need to leave just the shaded region
If the 2 radius values are not in order by size, merge them, sort them and use “list item” to use the first as the smaller and the second as the larger.
This is quite complicated. Your top drawing, where you start the topic, may not be the same as your last drawing with the two small and two large circles. In your last drawing, when all the radii are known, only one distance is needed to define the other distance.
In your original drawing, you define two distances.
In your last drawing it means that it is overconstrained with two distances, because only one distance is needed.
The last drawing is just a representation of what full circles would look like. It is based on the first drawing with all the dimensions. However Riccardo Majewski correctly pointed out that only 3 of the 4 dimensions are required.
Next step would be going into c# coding and make it output a null when the 3 values can’t generate a proper shape.
Doing like this, with math or geometric constructions, makes us understand and appreciate more how helpful is parametric sketching. One doesn’t need to know math but the software will create a precise accurate result anyway (when possible).
Instead, learning to actually visual-programming a shape, make you remember high school geometry/math and make you nearer to the actual programming.
After having see it work with visual code going further and coding it with c#/python is much simpler.
I started like this years ago and now most of my work is c# inside grasshopper.
For fans of tangents (literal and figurative), this construction is one of a family of curves called Polycentric Ovals, famously used by Borromini in his baroque churches.
This fascinating combination of maths and architecture covered in depth in “All Sides to an Oval” by Angelo Alessandro Mazzotti which can be found online if you look.
This is a 4-centre oval as in the OP, but any multiple of 4 works. It is highly likely that the Colosseum in Rome was aligned to an 8-centre oval for example. This would have made the concentric plan of seats and passageways trivial to set out, as opposed to ellipses which cannot be concentric.