Grasshopper

algorithmic modeling for Rhino

I was interested in creating a rectangle inside a curve 

I found this interesting video which explains the issue 

https://www.youtube.com/watch?v=AmgkSdhK4K8

then I tried to use grasshopper to do it, I had to use my permutation algorithm first

but when I needed to go into more precision, I needed to use Ander's Python sample. though, I used only 10 locations per point (4 points)

I still can't go to further precesion, even with Ander's fast tool as it needs about 1.8 Million of permutations

I kept the more precise option below, if someone has better computer, maybe can show me the result 

If you have any corrections/recommendations or questions, please let me know

:)

Views: 3501

Attachments:

Replies to This Discussion

Hi Hyungsoo,

Have you tried the bottom algorithm, is it Computable? 

my computer cant run it

I will have a look to both posts, Thank you 

And,

how close am I to the solution you think? if it's solvable? 

The attached definition, use David Rutten approach to find the closest possible shape to a Rectangle.

obviously increasing the number of division will make it more accurate.

Attachments:

Math is Magic, Thank you Mahdiyar, Thank you David

My aproach is a bit long and difficult but its using logic, not math I guess

Geometry is what make the script heavier and slower.

But I wonder if David has proved if either the two diamters are equal (or similar) or both share the center point (or at least close enough), to confirm if the polygon is a firm Rectangle or not

This Question is for David, 

have a look at this image (your rectangle is in Black lines)

I noticed on low resolutions (10 points ) we have different results and different point location, although we are working on the same curve 

Does this mean shifting curve starting points means different results? or is it a matter of resolution and both results will appear in higher resolution? 

The approach here seems to use closest point but the center of rectangle is on the intersection of surface/mesh. If you look at my definition you can approximate the location of centers by calculating faces intersection. So most of the time I think that center is on curves and not a single point.

Hi Laurent, 

Do you still have the file, I still can't get what you saying 

and, I have a dump question!

What is the relationship between the Geometry(the Mesh) and the Desired Rectangle/s

and, can you try to compute my other definition (second one) and see if it works? its heavy for my computer I guess

Hello Mohamed,

the file is here

http://www.grasshopper3d.com/forum/topics/inscribed-rectangle-proof...

Photos

http://www.grasshopper3d.com/photo/inscribed-rectangles?context=latest

Mesh height is a diagonal length, so when there is an intersection (self intersection) it means that 2 differents diagonals have same length, as they have the same X and Y it defines an rectangle. So to get  rectangle

  1. Calculate the Curve that is the self intersection of the mesh
  2. take a point (XYZ) on this curve
  3. Z is the length of the diagonal
  4. Draw a circle at Coordinate {X,Y,0} with a radius equal to Z/2
  5. Calculate the 4 intersections with the closed curve, => you got the 4 points of a rectangle.

At the moment it is not possible for me to see your defintion.

I don't think it is a question of curve intersection. It is a surface self intersection, it is well explained on Youtube, the self intersection is the big part of the demonstration, as there is at least one self intesection it means that there is at least one rectangle that can "have corners"/"be inscribed" on a curve.

Yes, I deleted my question, I realised I am wrong, now I am searching how I can self-intersect a mesh 

But in the circle which has many possibilities, mesh doesn't self-intersect, isn't it? am I right?

it creates a hyperbolic-like shape 

The circle intersect in one point ! It's center.
To self intersect a mesh could be done face by face without taking into account the edges. It is perphas possible to transform each face in surface and use surface surface intersection?

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service