Point Offset Script request

Next
 From:  Moi3dFan
11342.1 
There are problems in which it is required to place points equidistantly along a curve. I deallocate this every time through the circle + intersection. However, want a faster solution with an input field and slider.

Extras. It would be great if the point offset could be applied to the tangent points of the curve.

See screenshot. Thank you in advance!




  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
11342.2 In reply to 11342.1 
Hi Moi3dFan, usually for making rounded corners on a polyline you would use the Construct > Fillet command.

That also has an input field for the radius.

Do you need something different from that?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Moi3dFan
11342.3 In reply to 11342.2 
All that is required is the creation of points on the polyline, uniformly offseting points from selected points on the polyline, for further transformations.

And the additional question is about curve points, specifically creating additional CVs on the Hull to make the corners of the curve more pointed.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Moi3dFan
11342.4 In reply to 11342.2 
Essentially, I want a macros to be executed that will perform the following sequence:
- Selected points on the polyline
- A circle is constructed from these points (customizable)
- Then the circle intersects with the polyline and creates two equidistant points
- The circle is removed

Thus we get the displacement of these points
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
11342.5 In reply to 11342.4 
Hi Moi3dFan, please try the attached script.

Instructions for installing scripts are here:
https://moi3d.com/faq#Q:_How_do_I_install_a_plug-in_script.3F

You can click 2 points in the view to dynamically change radius, or type it in and there is a mode for generating points or for making a control point curve through the points.

Hope that is what you were looking for,

- Michael

EDITED: 8 Feb 2024 by MICHAEL GIBSON

Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Mik (MIKULAS)
11342.6 In reply to 11342.5 
Hi Michael,

very useful script, thank you.

Only one question...when I select points on polylines curve and run the script error message appear "No polylines or polylines points selected" although the polylines points were selected before run the script.

If I select polyline curve as a whole script run without problem and all points are rounded.

Is it bug or I should select the points in different way?

Mik

Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
11342.7 In reply to 11342.6 
Hi Mik, it sounds like a bug but I'm not seeing it over here.

Could you please post the .3dm file with your polyline in it so I can test with it?

I'm also not sure what the behavior should be for making a curve when only some corners are selected. Currently it makes a control point curve out of the whole thing with tighter bends in the corners that are getting added points.

Thanks, - Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Mik (MIKULAS)
11342.8 In reply to 11342.7 
Hi Michael,

the behaviour of script as I mentioned above is appeared in MoI V4, in V5 the script runs as you described in previous post.

Mik

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
11342.9 In reply to 11342.8 
Hi Mik, scripting access to object edit points is new in v5 so that's normal.

You'll need to run it in v5 for that part to work.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Moi3dFan
11342.10 In reply to 11342.9 
It works even better than intended! Thank you!

There are a couple things that could be improved:
- Points in "Make Point" mode are added to the polyline itself. You can made checkbox for this mode.
Of course, I can cut the curve by these points and then connect them, but I want a shortcut.

- Note that, in "Make curve" mode. If a polyline has only one point selected, then after applying the script the whole polyline turns into a curve. This is rather wrong, for I want to smooth out one point.
I have a solution though - I'll just detach the corner I want and apply the script.

Thank you for taking the time to do this, with scripts like this you make it very easy to work in your favorite program
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
11342.11 In reply to 11342.10 
Hi Moi3dFan, you're welcome I'm glad that is useful.

re:
> - Points in "Make Point" mode are added to the polyline itself. You can made
> checkbox for this mode.
> Of course, I can cut the curve by these points and then connect them, but I want a shortcut.

I've updated the script (attached in message above) to have an additional polyline mode where it generates a polyline with the new points in it.


> - Note that, in "Make curve" mode. If a polyline has only one point selected, then
> after applying the script the whole polyline turns into a curve. This is rather wrong,
> for I want to smooth out one point.

I've also updated it so that it will only smooth selected points and leave unselected ones as sharp corners.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
11342.12 
And seems working even Polylines are not planar!

And multiple! :)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
11342.13 
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Moi3dFan
11342.14 In reply to 11342.11 
Greetings!

I encountered a problem, when a polyline turns into a polycurve, the script doesn't work anymore

https://drive.google.com/file/d/1u2LwGowMSEeUYyLTR0SxRHH0jSVW0hO1/view?usp=sharing

Can this be solved?
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
11342.15 In reply to 11342.14 
Hi Moi3dFan,

re:
> I encountered a problem, when a polyline turns into a polycurve, the script doesn't work anymore

Yes, that's correct, the script is only designed to work on polylines which is what you requested.

Making it work on other types of input would need a pretty different process, it would not be a small change to the script.

I'm sorry I'm not able to do it at this time.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Moi3dFan
11342.16 In reply to 11342.15 
It's ok, I found a way out by just disconnecting the corners I want and applying the script to them.

I sorry for the distraction, I hope everything is going well with your work
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All