Midpoint of a curve?

Next
 From:  bemfarmer
5165.1 
Is there a script to find the midpoint of a curve?

For open curves, which are symetrical, and planar, with the UnwrapCurve script a line perpendicular to its midpoint seems to
locate the midpoint of the curve. Does not work for flat helix, nor for 2d logarithmic spiral.
  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 T. (MICTU_UTCIM)
5165.2 In reply to 5165.1 
Hi bemfarmer,

I don't know of a script, but here is what I do using array and a point:






Hope this helps.

Michael T.
Michael Tuttle a.k.a. mictu http://www.coroflot.com/DesignsByTuttle
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:  Mike K4ICY (MAJIKMIKE)
5165.3 
Clever!
  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 T. (MICTU_UTCIM)
5165.4 In reply to 5165.3 
Thanks!
Michael Tuttle a.k.a. mictu http://www.coroflot.com/DesignsByTuttle
  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
5165.5 In reply to 5165.1 
Hi Brian, yup the way Michael T shows is the way it can be done currently - Array Curve works by distributing things in even increments of distance as traveled along the curve so it will work for that.

UnwrapCurve just places the generated line's midpoint at the midpoint between the endpoints of the curve - that will only give you a wiggly curve midpoint for symmetrical curves, and you don't need to use UnwrapCurve to create that midpoint for those cases, you can just drag out a construction line between the curve's ends and then there will be a midpoint snap on that construction line to get that same point.

Thanks Michael T for showing the way!

- 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:  bemfarmer
5165.6 In reply to 5165.2 
Very nice.

Create Catenary.

Unwrap to see that actual Length of catenary is slightly less than selected distance, due to the fact that
the catenary is being approximated by nurbs control points.

Place one point on end of curve.

Do circular array of point on catenary curve, with an item count of 3. (or 5 or 7 ...)

Trim the catenary curve with the points, and change the color of the segments.
Select all the catenary segments, and Unwrap them, and see that the distances add up to the same total length.




EDITED: 19 Feb 2014 by BEMFARMER

  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 T. (MICTU_UTCIM)
5165.7 
Thanks guys. Always nice to be able to contribute! MoI is such an awesome tool!

Michael T.
Michael Tuttle a.k.a. mictu http://www.coroflot.com/DesignsByTuttle
  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:  bemfarmer
5165.8 
Here is a very simple little script to find the Midpoint of a curve or an edge, closed or open.

I needed a simple function to get the midpoint of a curve segment, so writing this script helped to clarify the coding.

This code of this script has a very high percentage, modified and adapted, from LineWeb and BlendCap scripts.

The script could be made much more elaborate, to pick multiple curves and/or edges, and find Midpoints of them.

- Brian

EDITED: 6 Jan 2018 by BEMFARMER

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:  mkdm
5165.9 In reply to 5165.8 
Hello Brian (and everyone...and happy new year!)

Thanks a lot for this very useful script!

I've tested it also on a 3D curve and on a merged edge and it works fine (also with V4).
(With "merged edge" I mean an edge that I first trimmed and the merged with "merge" command)

Ciao!

- Marco (mkdm)
  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:  bemfarmer
5165.10 In reply to 5165.9 
Marco, thank you, and thank you for the testing.

A brief, extremely simple self reminder, about MoI in general:
Hidden edges or curves cannot be selected until they are unhidden, using Hide or Styles of Types, or some other script. :-)

It seems that objects saved by MoI and reloaded may have a few previously hidden edges unhidden.
It seems that objects saved by Max's ObjLibrary , and reloaded with customUI, have ALL previously hidden edges unhidden. (?)

- Brian

I assigned Shortcut key "M" to _CurveMidpoint.

EDITED: 7 Jan 2018 by BEMFARMER

  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:  bemfarmer
5165.11 
It might be nice to redo the script to conform to the behavior of "_MarkCurveStart" script.
And call it "_MarkCurveMidpoint.

- B
  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:  bemfarmer
5165.12 In reply to 5165.11 
Here is the script _MarkCurveMidpoint, which works like _MarkCurveStart.
Now I have shortcut key Alt+M to get curve or edge start points,
and shortcut key M to get the midpoints.

The script is essentially the same as _CurveMidpoint, with a for loop...

- Brian

  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:  Michael Gibson
5165.13 In reply to 5165.10 
Hi Brian,

> It seems that objects saved by MoI and reloaded may have a few previously hidden edges unhidden.

Yeah I happened to run into this recently as well - it's a bug where the last edge of a brep doesn't get its stored hidden property loaded. It's fixed for the next beta.

- 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
 

Reply to All Reply to All