Aligning/Orienting Curves

Hi, and thanks for taking the time to look at this.

I’m fairly new to Rhino, and 3D work in general.

What I have is a set of circumferences made around tube-like irregular objects (think tree branch). I have 4 evenly spaced circumferences on each object, and i have about 160 objects. These circumferences are closed curves, and they all share a reference point via a line running down the length of the object connecting the circs. The circumferences are basically lined up, although they can be angled if the irregular object is bent.

What i want to do is make four graphical comparisons of each one of the circumferences. I would be comparing “like” circumferences. Right now, I am grouping the single points and the curves and translating them to the origin. However, some of the curves are angled or tilted, and I have to manually straighten them out so that they all line up to the XZ plane. Is there any way to get the curves to straighten/or best fit automatically? I’m open to suggestions (aligning on the centroid, ect). I want to get them all lined up so I can just turn on/off the layers and take a screen shot from one location to get a visual representation of the the differences in sizes.

Thanks!

Here is a picture of the circumferences as they exist on the scan:

In this picture I have translated all of the single points to the origin, but I would like to be able to revolve/angle the curves so that they fit (as well as possible) to the vertical black line (or the XZ plane):

Here is a picture of what I am trying to get to, but with only 2 circumferences so far. I think I may want to rotate on the common point a bit differently, but hopefully this picture will clarify things.

Edit: added sample file

CircumferenceAlign02252015.3dm (80.4 KB)

You can rotate the curve individually in the edge view to get them close to the construction plane…
Then turn on their points (F10), and use SetPt to change the Z coordinate to construction plane 0 to get them perfectly flat.

1 Like

Edit: Previous suggestion of OrientOnSrf does not work as I thought it did.

ProjectToCPlane is an alternative to using SetPt to flatten the curves.

Edit: Or if the curves are aligned with a flat surface use Project or Pull to flatten the curves.

1 Like

Thank you for the reply, John_Brock.

A few things (SORRY!)

-When you say edge view, I don’t know exactly what you mean. Do you mean like the view in my second picture?
-When I select a point, and set it to 0, it just moves that one point in the curve. I do not want to alter the shape of the curve at all (want its length to remain consistent!

Thanks!

Thank you for the reply!

I created a plane on the X and Z axes. When I try to OrientonSrf, the circumference curve is more perpendicular to plane. Maybe this could be because i’m using my base point that’s on the edge of the curve? Is there a way to make the base point the centroid of the curve?

I initially planned on projecting the curve, but the resulting projection is a different shape (sometimes by just a little bit). I do not want to alter the curves at all. I want to be able to view them all so that they oriented the same way. In theory,I could orient the camera to each one in the same way, but that seems like a bigger task.

Since the the curves are not planar, I understand that i wont get it completely flat. I basically just want to get them lined up to get a visual comparison that make sense.

Thank you!

If you post the file, someone might be able to 'help’
clk

1 Like

Thanks, ChrisK.

I uploaded a sample file to the original post.

Some info about it.

There are 4 layers, each with 4 sublayers that have a circumference curve in it.
There are two layers that I imported from the individual object’s 3DM files. I plan on copying over all of the other ones once I figure out what I’m doing. There will be a total of around 160 layers.
The other two layers are copies of the first two where I’ve just grouped with circumferences with the “reference” points, and translated them to zero. They have not been angled in anyway.I just left them here to show where I was going…

I intended on viewing from the “front” and turning on the same circumference sublayer for each object to visually compare similar circumferences.

I’m extremely open to feedback, and I’m really grateful for the helpful community.

Scratch my idea of using OrientOnSrf. It doesn’t work as I thought it did.

For centroid of a surface bounded by a closed curve:

Create a surface bounded by the the curve using Patch with the Auto Trim option.

Use AreaCentroid for the centroid of the surface.

1 Like

Another approach for orienting the curve on the CPlane, centered about the (approximate) centroid of a surface bounded by the curve.

  1. Determine the centroid as described above.

  2. Create a plane which is aligned with the average of the curve.
    a) Divide the curve to create a set of points on the curve. 100 points is a reasonable number.
    b) PlaneThroughPt to create the plane

  3. Pull the centroid surface onto the plane created in the previous step.

  4. Use Orient3Pt to orient the curve on the CPlane
    a) Ref Pt 1 is the “centroid”, Ref Pt 2 is in the x direction from the centroid on the plane created in Step 2, Ref Pt 3 is in the y direction from the centroid on the plane created in Step 2.
    b Target Pt 1 is the origin. Target Pt 2 is somewhere along the x-axis, Target Pt 3 is somewhere along the y axis.

1 Like

with non-planar crvs there’s a problem.

I used patch on the crv, found the area, then rotated the crv about 0, patched again, areas the same.

It will be a bit of a chore to do this for all your data, but I don’t see another way, except maybe with a script [which I’m incompetent to do.]

Good luck.
clk

CircumferenceAlign02252015ck.3dm (114.4 KB)

1 Like

Thank you for this tip, I had been trying to figure out a way to do this!

This works! Thank you for the information, @davidcockey !I was always confused by the orient 3pt, because i assumed there would be deformation involved unless I got the spacing exactly correct.

EDIT: The forum complained that I was posting too much (Sorry, brand new here) so I’m going to thank @ChrisK in this post as well. @ChrisK, did you patch again just to make sure that rotating didn’t deform the curve/patch? Thanks for taking a look at the file.

I wish I could script too, but it looks like I will be going through everything using @davidcockey’s method manually.

Thanks again for the help!

I think you can ignore that- use your judgement.

-Pascal

Hi. Does anyone have an idea to orient a plane of an object perpendicularly to a point? I’m looking to have this done in project right now. I want to array in a polarized manner around center points of other objects while moving them freely in proper orientation. I have a snapshot to help explain.

I’m also using a cumbersome method using lines for measuring and anchoring. I’m interesting in learning a faster method. Any ideas? Thank you.

Hello - I cannot quite tell if you want to get the object positioned and oriented to begin with, or just need to move the object in and out from the center…? Can you post a simple example file?

-Pascal

I’d like to get the objects restricted to orientation, yet still able to move but only according to what orientation allows. The idea is to 3 dimensionally copy, paste, and arrange objects in a free flowing manner while keeping them oriented. Like orienting objects to a curve but this time only to a single point.

I actually found the answer while trying to specify myself for you. Just create a circle and orient objects perpendicular to its curve. This will, by association, orient objects to a single point (the circle’s center). If anyone knows a better way to orient to a point please share. Thanks.