Planarize control points

Hi Blastered - can you post the surface before and after you manually move the points UVN? I’d like to know if the points move on the control polygon, or the control polygon ‘extensions’ or the surface tangent.

In the meantime, here’s a maybe-better version in terms of workflow - give that a try- Drag and drop makes two alieses

PlanarizeU
PlanarizeV

The action is still closest point, not working along the U and V yet.

PlanarizeSrfPts.zip (1.2 KB)

thanks,

-Pascal

Hi Pascal,

i did a manual planarization with all combinations and one with the script (attached) (select all and zebra)

if i analyse only one surface, every UVN move mode is OK, no big difference by the means of planarization and surface geometry change. a script that moves the points UVN in any mode is Good!

all methods are good for “individual” surface if there is an adjacent one to this surface with G1 some mixed method should be used. in mixed method there is no continuity problem but i don’t know if the script can maintain the continuity and i guess it will be a tough one to make.

Anyway an UVN moving planarization script will be sufficient and great.

Thank you @pascal

PlanarizeSrfPTS vs manual.zip (73.1 KB)

Hi Blastered - See if the attached does anything useful for you- I’m not sure it will, but have a look- it seems to work on your examples, but I’m sure I have some work to do. If you choose the Auto plane, the thing looks at the control polygon from each point and moves the point to whichever side’s control polygon or extension hits the plane nearest to the current point location…I don’t know how to make a better guess.
Note there is nothing done with N yet- only U and V are affected, the N for a point may well change as a result of the control polygon/plane intersection but that is only a side effect. I’ll see if I can make something that smooths in N

Edit: Bleah, never mind, I immediately found cases where it fails or makes a mess - I’ll post it back later.

-Pascal

Hi Pascal,

I cheated and downloaded your script from the notification mail :smile:

it works some cases as you said and i will use it till you make a new one

Thank you very much

@Blastered, I think this is better now… sorry, sieve-brain syndrome…

PlanarizeSurfacePoints.zip (10.3 KB)

Edit:
@Blastered
I monkeyed a little more- this one offers smoothing in the Normal direction as well as UV. I’m not sure if it is any use, but give it a spin. Drag and Drop for SmoothSurfacePoints It does all that the previous incarnation did and adds a command line option to SmoothNormal=Yes/No (default is No). It is a first quick hack, I will tune up the Normal part of the process, I think I have a better way to do this. Click a point multiple times to smooth more. Let me know what works, if anything, and what’s broken…

SmoothSurfacePoints 1.zip (12.1 KB)

I monkeyed still more…I think the normal smoothing is better now, and I added a second command,

SmoothN

to just smooth or fair rows of points Normal, without any planarizing - probably more useful that way.
Added the option to preserve edge tangency - if set to Parallel or All, points adjusted in the tangent rows of points are forced to move to the plane only in the direction of the edge points.

SmoothSurfacePoints(3).zip (20.6 KB)

See how it goes…

-Pascal

Hi Pascal.

wow! just wow! Now Rhino has a new tool that i will use every single day.

(i only tried the SmoothSurfacePoints(3).zip by the way why “Smooth”???)

some times i was lazy to modify the geometry to see other alternatives for my design because of manual planarization process was time consuming but from this point on, thanks to you, it will not be the same.

my thoughts about the script;
-parallel is a big time saver and from my little experience it can be default (i will use it that way and analyze a little more)

  • i dont know if it is possible but an automatic planarization (especially at edges) would be much more time saver and would allow further experimentation with the geometry. But it is a luxury not a necessity.

hope to see it in the new release by default, Thank you!

P.S. how can i delete old commands (_PlanarizeU, _PlanarizeV)

Hi Blastered -

OK! Good to know it is on the right track. I’ve added a couple of things to try and I’ll post a newversion later.

I’ll make Parallel the default for PreserveTangency.

I’m not sure what you mean - planarize all edges at once? In the version I’ll post later I have done the opposite - do all interior points at once, respecting the tangency setting, and leave edge points in place…

To remove PlanarizeU etc, delete these Aliases from Options > Aliases, then in Options> RhinoScript, delete the PlanarizeSrfPts.rvb script from the list of scripts to load at startup.

-Pascal

Hi Blastered - here is a new version - it adds a ‘Mode’ setting - modes are

Point, Row, All.

When set to Point, all points in the row are used to calculate the plane but only the clicked point is moved, if it is allowed to by the Tangency setting.

When set to Row, the entire row is moved as allowed by the Tangency setting - this is default and how it was in the previous version.

When set to All, all interior rows in the selected direction are planarized.

SmoothN has the same Mode settings.

SmoothSurfacePoints(4).zip (27.0 KB)

-Pascal

Hi Pascal,

You are amazing, more than what i ask for and you keep developing it to a further point, so i will try to help you on this. Here are my thoughts and some analyze results;

Smooth Surface Points;

-“point mode” is very good honestly, If the surface has 4 point row. But if the surface has 5 or more a problem occurs. I think Script/Plug-in should not add the selected point to its calculations. Selected point is a problematic child so using it for calculation is not beneficial. As in the attached 3D model (bottom Row marked as 1) (using; Point, U, Auto…) result is not planar. i think when point mode selected planar/fit plane should be calculated with other points.

-For “All mode” a “Both Directions” option would be good which will tell the Script/Plug-in to make all inner point Rows planar. not sure but it may need to move points at “N direction” for minimizing the geometry change (i don’t need that now but maybe someone in future does)

-What i mean about automatic planarization at edges is a dynamic transformation or a feed back geometry like what blend surface/ Adjustable Blend curve… commands does. the user will move a point and script/plug-in adjust OTHER points to be planar again (something like reverse of point mode), but of course except Both Ends. By the way in this process user may want to move end points also.

-Script can open move uvn tool for fine tuning automatically. If the user ran the script/plug-in there sure need some tweaking at other directions. In “V row mode” selected row of points moves at U direction so user may need/want to move a point in v direction which i presume wont breaks the planar order. but this one can be frustrating so i am not sure about that what do you think?

SmoothN;

To be honest i am not sure in what circumstances one will use that but it may be fused with SmoothSrfpts in future. Do you have a scenario for me to understand it?

-From the start it may not written for that purpose but it breaks the planar point rowU/V (as marked 2, using, row, V, 10…)

-What is the “Smooth factor” margin? i typed 10 and 1000 both did the same.

Thank you.

SmoothSrfPts(4).3dm (256.1 KB)

Hi Blastered thanks a lot for testing and feedback -

Got it - I’ll see about that. But, in your example, the point at 1: Use PlaneThroughPt on all U points and again on all except Point 1- the latter does not seem like a good plane to use, does it?

I see… that might be possible…

I’ll look at your example files and get back to you on those questions.

The factor in SmoothN is a factor that the fairing uses internally- it should make a difference but the number is in current units, so there is probably a relatively narrow range that applies in any particular case- think of it as a sort of very approximate distance constraint for how far the points are allowed to move. OK, I see it is broken on your example file - it may be that the points are just too simple and that moving individual points normal with DragMode or MoveUVN makes more sense. I’ll see if I can figure out what it’s doing.

thanks,

-Pascal

Hi Pascal,

IMO this is the plane if point mode selected, but may be both options needed.

thanks.

Hi pascal,

i encountered a situation which Smoothsrfpts messes it up and smoothN needs to be done repeatedly (my smoothfactor was 5) so i think script/plug-in needs a verification process checking if the row is planar? if not it repeats processes over again (but this may lock rhino i dont know). a temporary curvature graph can be implemented while scripts/plug-in runs!

And this situations tells me both scripts should be merged. otherwise user needs to try the other script while s/he just wants to planarize selected surface point row.

So i propose that, script calculates planar surface and then finds the shortest way to the planar surface from point among U/V tangent extension, U/V controlpolygon and N direction. What do you think?

There are manual, original and scripted surfaces in the 3D model.

thank you.

SmoothSrfPts(5).3dm (239.7 KB)

Hi Blastered - I think that in any event this is not a great test case - that is, the tool is really designed for tune ups and not for major editing - there are so few points here, and the out of whack ones are so extreme that a hand edit might make more sense before using the tool. I’m not sure it makes a lot of sense to try to figure out what is the ‘correct’ solution in this case - would you agree?

I do think that in a less out of whack situation, or one with more points to sample, the idea of excluding the picked point when in ‘Point’ mode is worth a try.

thanks,

-Pascal

Hi Blastered - that is expected, I guess - the points are all in, or near, a horizontal plane and Auto plane will make them move nearly parallel to the plane, thus moving a long distance before encountering the plane.

-Pascal

Hi Pascal,

for “smoothsrfpts(4).3dm Dot1” may be an exaggerated one but what if it was only 1 unit different than other planar points? it wont be a major edit but a minor tune up.

anyway i am just telling my thoughts about the script, may be some third point of view is needed :wink:

Hi again,

yes, at first when i tried smoothsrfpts on these points i was like “what!” then tried smoothN and realize that after using a factor like 5 it didnt made the point row planar. so i thought there is a need of control mechanism for this script thats all :blush:

thank you.

@Blastered, here is an updated version- it excludes the point from the plane calculation when in Point mode. Let me know if I broke anything…

SmoothSurfacePoints.rhp (31 KB)

-Pascal

thank you, this is changing start and end points also but it is ok if the problem is with the selected point :slight_smile: a throughout trial will wait a little bit i am in a tight schedule.

Hi,
I want to planarize e set of point by moving them only in z direction according to lines. Only point has a line as guiide and I need to planarize according to these lines.
How can I do that?
Thanks a lot

If it is truly only in the z-direction, you should be able to use the SetPt command.
If you are after something more involved, please post a Rhino file describing the problem.