Planarize control points

This should be in default Rhino :innocent:

Ouch, discovered that your script doesn’t leave the end points in place… which has the potential to ruin G0 alignment:

planarize

Any chance for an option to only adjust internal control points unless you explicitly select an edge control point?

If there are 3 points in a row script should not do anything right?

Hello - I’m not sure what I am looking at there - can you post the surface? OK, I see - right, it moves the entire row…using the 2pt option and snapping to the edge point may be one way out. With the Auto plane I can make it anchor on the ends too, I suppose…

-Pascal

1 Like

Looking forward to this anchor option, if you get the time to do it!

Hello - this one does what you’re asking, I think - it just does it - should it be optional?

  1. Finds a best fit plane through the row points
  2. Finds an average location of all the points except the end ones
  3. Pulls that average point to the plane
  4. Makes a plane through the two ends and the point on the first plane.

It’s kind of fudgey… does that make sense as a final plane?
PlanarizeSurfacePoints.py (18.8 KB)

To use the Python script use RunPythonScript, or a macro:

_-RunPythonScript "Full path to py file inside double-quotes"

-Pascal

5 Likes

Yes! Only did a brief test, but this seems perfect. 100% fulfills my needs. Thank you so very much! :sparkling_heart:

1 Like

Hi,

I have just found the oportunity to test the latest “PlanarizeSurfacePoints.py” but my test showed me the old script “smoothsurfacepoints.rhp” has one or two things that can be added to the new one which is:

-point option : for an irregular point that would change the auto fit plane drasticcaly thus leads undesired planarizing of rest of the row, so we choose point mode for that bad boy and planarize it with an auto fit plane created by rest of the row.
-smooth normal…
-preserve tangency…

kind regards

Found an interesting “bug” on a surface where the U direction seems to be the same as the V direction:

bild

uv.3dm (791.0 KB)

The script still works fine, the indicators are just drawn wrong, so it’s a minor thing.

Just saw this thread revived, and it reminded me that the “to Plane” option in the new _Align command really needs a 3-point plane option. Do you think that’s worthy of putting in jetbrains? As is, now, if I want to get the same effect, I think I need to draw and delete a plane and use “to surface”

Hello Pascal,

I tried your script today and liked it very much.

One thing i noticed though, is that the plane option creates a plane perpendicular to the Cplane. This is a cumbersome workflow, as Control Point rows of a patch often do not lie perpendictucular to a single CPlane.

Generally you would use a tracing technique to find the cleanest alignment path for each row.

plank-straightness

Currently this requires to set the Cplane to active view for each CP row, then apply the Align Tool.

A preferable approach would be to create a plane perpendicular to the active view right away. Could this be added? Same goes for Cutting Planes.

I do understand the necessity of using the Cplane for many alignment cases, however for general Control Point Row clean up, that additional step is more of a hindrance. Also, new users might get confused when aligned points end up NOT lying on the 2-Point line they just drew.

Additionally, the cleanest away to align a CP row would be to have the CP travel along their tangents until they lie on the alignment plane, instead of just pulling each CP in the CPlanes normal direction. Is there a way to achieve this?

Hello - are you referring to the PlanarizeSurfacePoints thing? There are various options for the plane - the one called View is actually parallel to the view direction, perp to the view plane - is that what you are after? I’ll tune this thing up a bit when I get a chance, to draw the ‘active’ plane, if that makes sense.

-Pascal

Yes, the planarizing surface points tool.
Exactly, thats what I meant, perpendicular to view, regardless of active CPlane.

Which one is the correct script?

@Cadworx - this is how it should work:

Is that what you are looking for?

-Pascal

1 Like

@pascal

Actually not. I would expect this behavior (yellow):

That is what it will look like in a parallel view - in perspective it cannot look ‘right’ unless the view is exactly centered.

-Pascal

@pascal

Yes that makes sense. Thank you.

In what direction are the Control Points moved?

Could this behavior be added to the Cplane and Cutting plane options? The 2 Point tracing/View approach is actually the one i use the most.

I think there’s a “best fit” option, which generates a custom plane per row…

But this discussion should perhaps be moved to the proper thread, as I didn’t mean to derail this one:

1 Like

My explanation was unclear. What I meant was creating Cplanes and Cutting Planes by 2 Point Tracing, perpendicular to view. Not for Control Point manipulation, but for general usage.

Combining Cutting Planes with 2 Point Tracing and the new TrimRefit command creates exellent results!

Yes, maybe @pascal could move these posts to that thread.

@Cadworx - just fyi, for now:

 _CPlane _View _CutPlane _Pause _Pause _Pause _CPlane _Undo

I’ll move the conversation.

-Pascal

1 Like