Grasshopper

algorithmic modeling for Rhino

Hi,

mathematically speaking, I don't know how to find a cross product between multiple lines (more than 2).

I tried using a geometric approach to go ahead:

given some triangular surfaces, i find the intersection line (blue crvs) between a sphere based in the common vertex of these triangles and the triangles itselves.

Once i have this surface I try to get the centre and connect it to the initial common vertex (violet crvs).

This line represents the most barycentrical line of this geometry.

The problems are:

1) Too heavy to calculate for hundreds of vertex, as I need to work with surfaces

2) The centre is not so precise, because of the optimisation that GH does in these super freeform surfaces.

How to get the centre using only the edges?

Thank you!

?

Views: 6505

Attachments:

Replies to This Discussion

Bad news: the umbrella sticks are not the surf normals (did some "minor" mistake in a not posted (yet) code).

Good news: see attached.

Attachments:

{0,0,0,1}

done.

Thank you Peter,

I tried your def, but it looks it panelises a given surface. Actually I already have precise surfaces (triangular) and they form many "umbrellas". correct me if I'm wrong and... thank you again!

What means the but in the  "but it looks .. a given surface" ? It can extract panels (in 3 modes) from any (open) surface List - not only a single surface (that's the first dimension in the sData Tree is for - to "index" surfaces). Anyway in order to test this you can connect the test 2 surfaces provided in the sList (= List of surfaces):

Thus, if you want:

To access an x panel:

Brep panelX = (Brep)sData.Branch(surfaceIndex, Uindex)[Vindex]; // cast is required

To access an x panel  edge:

Curve edgeX = (Curve)sData.Branch(surfaceIndex, Uindex,Vindex,2)[index]; // cast is required

blah, blah...

The only thing remaining is to find the "centroid" of normals per panel per U/V surface division point. I'll do that in the next update (in fact is ready and working, but I'm thinking to replace portions of some code in order to speed up calculations).

For instance I used that AreaMass... method in order to find the centroid per triangle (normals are the normal of a 3 pts Plane):

but as it says: slower than a Harley.

more soon

poli orea!

keep in mind that, if you use a regular surface (as yours), it is quite easy to have an umbrella stick, because it is almost a pyramid.

Have a look at my first surfaces (at the beginning of the post). They could help for test.

the only way I try to do is to intersect all the panels with a sphere in their common vertex, taking the super irregular surface and find the center of this surface...but, as I said, very slow and not precise.

efcharistò!

Well ... that regular surface is yours actually ( I remade it in order to skip entirely Lunchbox/OrSomeSimilar).

Right now the - ready - UmbrellaStickMaker C# (build:D) is under tuning for performance. For instance by replacing this with that the Elapsed time is down almost 10 times:

Another VERY stupid idea was using LINQ for sampling the normals (per triangle) and finally computing a separate UmbrellaStickDataTree. Very slow (replaced with some weird index finding algorithm).

I'll post the final definition here soon.

I guess you took the surface from the other post :)

the attached is the correct one

Attachments:

I havent understand what you want to achieve XD, the specific details of the final vector/line you want....

btw, take a look on this.....

is this completely wrong? :P

Attachments:

Thank you riccardo and sorry if I was not so clear.

Here my goal:

Attachments:

MAYBE i've found something.... maybe...

Something with steradians and stuff... first i need to learn what those are :P

Or have you already resolved?

If not, just a particular... if we say barycenter... you say area or volume?

This is what I did so far:

If I consider center of volume, it calculates a wrong volume starting from these surfaces and it makes a super wrong vector.

If I use center of surface, the result is what you see in the image... quite good, but very slow to generate all those patches and not so precise.

That's why I was considering to work with vectors and not with surfaces

not volume then? mmm

I still can't understand for what you need this vector :D

What about this?

This .gh split a sphere surface centered to the main vertex with the red surfaces and get its area centroid.

Its probably heavy because use a brep boolean and calculate the area of a nurbs, just tell me if the results sonds good.

It should be possible to achieve the same result way faster, working with steradians and triangular based pyramids "filling" the infinite volume section.

Maybe the vectors are reversed respect of what you need...

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service