Grasshopper

algorithmic modeling for Rhino

Hello I'm having trouble drawing a curve on a trimmed cylindrical surface. Attached are my files and a picture of what I want to achieve. The green lines on the attached picture are the lines that I want to achieve as output of grasshopper. 

I've tried crvsrf but it didn't work, anyone know how to do this? Thanks.  

Views: 1928

Attachments:

Replies to This Discussion

Like this?

Attachments:

Hi Peter, thank you again lol! Are you always around? 

U just made me realize a thing: that my definition, even though logically different, achieves the same thing as yours. Man it's a math revelation I wasn't aware of ... I guess my attached diagram shows what I mean. The first drawing is basically your logic of a secant between a plane and the cylinder, which will always result in a planar curve. The second drawing was my definition in which i was trying to divide the - trimmed with a plane - cylinder equally into vertical segments, and then equally divide the resulting curves and link them. Well that sounds complicated, in diagram it's a glimpse. 

But my real issue is how to draw line on the surface that isn't planar, like in the third diagram. I drew it using interpolate curve command of rhino. But I don't know how to do it in grasshopper. I tried crvsrf in grasshopper but it didn't work as the resulting crv always ends up not on my surface and out of nowhere. 

Then I experimented finding that it has something to do with the evaluate surface of grasshopper. Yet I don't really understand this evaluate surface thingy cause when I use it on my trimmed cylinder, it creates another geometry out of nowhere which is completely separate from my cylinder .... You can see attached file if you want. 

So how to draw a curve on the surface of the trimmed cylinder that links points on the cylinder, and that isn't planar. Is there a way? Btw nice design of your definition color it doesn't look like grasshopper at first LOL. Almost got me .. 

Attachments:

Sorry for the mess of the above text. Well I realized that it's not that crvsrf is linked to evaluate srf, that was stupid.. It's just that they both use uv as input. 

I only know the coordinates of my points in xyz. How do I convert them into surface uv? I guess this is what I'm really asking. 

Hi Peter, 

I think the problem is solved. I found several threads about my question and it's just that I need a closest point to a surface component to translate the xyz coordinates to a uv coordinate, and then apply it to my crvsrf. I much appreciate your input though. thanks. :) 

it creates another geometry out of nowhere which is completely separate from my cylinder

Well ...

A chopped surface (i.e a trimmed thingy) is NOT a surface: is a Brep (Boundary Representation) meaning that this object "contains" the underlying "guide" surface plus trimming "instructions".

Several Methods (used in native components and/or plug ins) work on the underlying surface > the out of nowhere thingy, he he. For instance try Lunchbox "panels" on some "surface" with holes and/or trimmed outer loop.

The "world" in a "surface" is expressed in terms of u/v coordinates (instead of x/y). Spend some time on the related literature on these things to get the whole gist of the matter.U/V values are within something called Domain for U/V. If you have a point "on a surface" that you want to "translate" it in the surface world use these:

If several Breps are "stitched" together this yields also a Brep (or closed Polysurface in surface modellers like Rhino). Breps hold information (and connectivity) about edges and "faces" (called - obviously - BrepFaces) in a "similar" manner that a mesh keeps track of vertices/edges and MeshFaces.  

Notify if you need something that does this on Brep Lists (but is solely code).

Anyway ... get the trad update (added 2 options more) ... just in case.

Attachments:

Thanks for the explanation Peter, also for

Notify if you need something that does this on Brep Lists (but is solely code). 

___________________________________________________________________

Man I don't know how to code... yet.. 

I managed to get the thingy working, well, kind of.  I uploaded a picture of what my def accomplished with crvsrf, but it's very funny that they don't close the curve in a proper way. Attached image says it best. In rhino however, the interpolate on srf command - which should be the crvsrf command of grasshopper - didn't choke... 

Do you know why is that? Is it something with my list or is it programmed that way and I can't really do anything in this case? 

Attachments:

Several issues...

  1. Instead of relying on a Rhino file from several posts back, please internalize your curve Rhino inputs (done in attached GH file - no need for the Rhino file).
  2. The seam on your trimmed cylinder is not centered.
  3. I used 'Shift (-1 or 9)' to align the flattened list of "trimmed subsrf edges" to the surface seam.
  4. I enabled 'Reparameterize' on 'input surface' (the trimmed cylinder) to keep 'Srf CP' and 'CrvSrf' happy.
  5. I changed the 'C (Closed)' input of 'CrvSrf' from True to False - otherwise, the curve wraps back around the trimmed surface.
  6. I copied the first point in the 'uvP' list from 'Srf CP', re-constructed it using X=1.0 instead of 0.0, and appended it to the end of the list - physically the same 3D point but important in the UV space of the surface.

There is a discontinuity there at the beginning/end of the curve.  A flaw in the method that might be reduced if the surface seam was centered, but probably won't go away.

Attachments:

Hi Joseph,

Thanks you for your input! I checked your script and it definitely solved what I thought was impossible to do.

I didn't know that surface seam actually affects my operations... Is there any readings that you know that explains this mechanism in depth?

But I actually found a better way of doing this, which is simply just to use "interpolate crv" and "pull crv" instead of "crvsrf". 

I internalized my script and am quite satisfied with it right now. 

I love this forum man as it's always so quick and efficient without any bullsh'it, because of its people. 

If I have any other questions I may open up another thread I guess. 

Attachments:

The seam on the trimmed cylinder affects the begin/end of the U or V "space" (not sure which one without digging).

Yes, 'Pull' curve to surface is an excellent solution, and so simple.  I don't have LunchBox installed so can't see your latest code - did my own:

Attachments:

okay. actually I only used "swap surface uv" from lunchbox so my cylinder is cut vertically instead of horizontally. I'll look a bit more into the seam thingy. have a nice day.

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