Finding Tangents to a Curve
 1-2  3-22  23-42  43-61

Previous
Next
 From:  bemfarmer
11632.43 In reply to 11632.41 
??? An extra point might be created with a (closed) circle, if the tangent happens to occur where the curve start point equals the curve end point. (Seam in extruded circle) ???

- 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
Next
 From:  bemfarmer
11632.44 In reply to 11632.43 
A line factory can be used to create the line segment tangents, from pairs of points.
- 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:  Larry Fahnoe (FAHNOE)
11632.45 In reply to 11632.42 
Hi Brian,

Thanks for the link! One of the cool things about the book's code is that it also seeks to be computationally efficient...avoiding the expensive operations like the trig functions. Not that this really matters in this context, just shows that I'm old & have an appreciation of why fast code is worthwhile.

Here's the current effort but only because you mentioned trying it. Nowhere near complete...

--Larry

EDITED: 21 Jan by FAHNOE

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:  bemfarmer
11632.46 In reply to 11632.45 
Terrific script.

For the top die, the tangent points of interest lie "below" its centerpoint. (?)
A short arc can be built between these two points.

For the bottom dies, the tangent points of interest lie "below" their centerline. (?)

If the "seams" (join point) of the circles are placed in the proper positions, and the circles are in the proper orientation [ CounterClockwise left die with Clockwise upper die ], or [ CW right die with CCW upper die ], then the first tangent point encountered for each circle will be the desired one, pairwise. The seams should be closest to the centerline midpoint. Which is the lowest point on the upper die circle, and innermost point of the outer two dies. ( This might be the midpoint of the upper die? )

Does MoI have any ways to determine CW vs CCW for the circles?, or arcs?

image host

- 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
Next
 From:  Michael Gibson
11632.47 In reply to 11632.46 
Hi Brian,

re:
> Does MoI have any ways to determine CW vs CCW for the circles?, or arcs?

If you get 3 distinct points on the arc (on a circle don't get start/mid/end because start and end are the same), you can then calculate the signed area of the 2D triangle which will be negative for clockwise order, positive for counter-clockwise.

Script code for calculating this is here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=11521.42

- 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
11632.48 In reply to 11632.47 
Thank you Michael.

So if Larry decides to use CW vs CCW, the dies only need to be set up once, which can be done before tangent scripts are used...

The parametric order of crv.getTangentsToPoint( pt ) would be from circle start to circle end, around the circle. Or from arc startPt to arc endPt, around the arc.(?)
CW FLIPS to CCW (?)

- 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
Next
 From:  Larry Fahnoe (FAHNOE)
11632.49 In reply to 11632.48 
Once again, you guys are way out ahead & I'm the lucky beneficiary, thank you both.

--Larry
  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:  Barry-H
11632.50 In reply to 11632.49 
Hi Larry,
try this Bend Tool nod file you can adjust roller centres, radii etc.
Hope this helps it is based on https://www.youtube.com/watch?v=BTi0KM5vYPQ
Cheers
Barry

New version see http://moi3d.com/forum/index.php?webtag=MOI&msg=11632.58

EDITED: 23 Jan by BARRY-H

  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
11632.51 In reply to 11632.48 
Hi Brian,

re:
> The parametric order of crv.getTangentsToPoint( pt ) would be from circle start to circle end,
> around the circle. Or from arc startPt to arc endPt, around the arc.(?)

When you call crv.getTangentsToPoint( pt ), it will return a list of numbers. Each number is a curve parameter value marking the location on the curve of a tangent solution.

Curve parameters will be inside the parametric domain of the curve, between crv.domainMin at the start of the curve, ranging up to crv.domainMax at the end of the curve.

- 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
11632.52 In reply to 11632.51 
Thank you Michael.

If a programmer wanted to utilize the new list of numbers in order, from start to end,
is the list already in order, corresponding to: from curve start to curve end?
Or is it necessary to do any ".sort BySelectionOrder()," which is sometimes done when selecting geometry in other code ?

So the code line:
var pt = crv.evaluatePoint( params.item( i ) );
transforms (evaluates) each params number to locate/create a new RAW point on the curve, ( with coordinates in the current cplane ).
A line drawn from such a (tan) point, to the initial External point, will be tangent to the starting curve, at said new point location on the curve.

Sorry to be wordy, but it helps me to understand :-)

- Brian

I just ordered a used copy of the programmers book also.

On the API I also see the curve methods:

equallySpacedPoints? (No documentation in API)

getArcLengthParam Would this method enable a programmer to find the parameter where the ArcLength of the curve is some specific value? And evaluate the point there?

EDITED: 21 Jan 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 Gibson
11632.53 In reply to 11632.52 
Hi Brian,

re:
> If a programmer wanted to utilize the new list of numbers in order, from start to end,
> is the list already in order, corresponding to: from curve start to curve end?

Yes the returned list of parameters is sorted in ascending order.


> So the code line:
> var pt = crv.evaluatePoint( params.item( i ) );
> transforms (evaluates) each params number to locate/create a new RAW point on
> the curve, ( with coordinates in the current cplane ).

The resulting point will be in world coordinates, not necessarily in the current cplane.

If you want coordinates relative to the current cplane you would need to transform it.


> A line drawn from such a (tan) point, to the initial External point, will be tangent to
> the starting curve, at said new point location on the curve.

Yup, like this:





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

re:
> equallySpacedPoints? (No documentation in API)

crv.equallySpacedPoints( NumSegments ); - takes one argument for number of segments, returns a list of NumSegments+1 parameter values to produce segments of equal arc lengths.


> getArcLengthParam Would this method enable a programmer to find the parameter
> where the ArcLength of the curve is some specific value? And evaluate the point there?

crv.getArcLengthParam( NormalizedDistance ); - takes one argument of either a number or sorted array of numbers with normalized distance values between 0 and 1 and returns curve parameter values for position at that arc length along the curve.
So for example crv.getArcLengthParam( 0.5 ) will return the parameter value at half the distance along the curve.

- 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
11632.55 In reply to 11632.54 
Hi Michael.
Your documentation is excellent. IMHO

Maybe PEER will update the MoI v5 API?

-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
Next
 From:  Larry Fahnoe (FAHNOE)
11632.56 In reply to 11632.50 
Hi Barry,

The Bend Tool node looks to be very flexible & quite handy, thank you!

Was the material thickness/diameter problematic? I thought it was a helpful feature.

--Larry
  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:  Barry-H
11632.57 In reply to 11632.56 
Hi Larry,
I will add that option.
Barry
  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:  Barry-H
11632.58 In reply to 11632.56 
Hi Larry,
attached new nod file with material thickness plus solid or curve option switch added.
Also added inclusion angle and error warnings if rollers are to close.
The top roller is limited to stop an error if moved to high.
Cheers
Barry
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:  Larry Fahnoe (FAHNOE)
11632.59 In reply to 11632.58 
Hi Barry,

WOW, you're really cooking with gas! ;-}

Here's some more background on what I was initially setting out to accomplish. Again, this is intended to roughly simulate bending metal in the real world. In designing a bend one of the key things to keep track of is how the material deforms as a result of the bend. You've got the centerline and thickness/diameter modeled, but what is needed to is to adjust the length of the straight portions of the centerline as the bend progresses & this is mainly done by subtracting the length of the arc that forms on the bottom of the top die. The change from Bend Tool to Bend Tool Plus made the centerline two independent "arms" if you will, but to approximate reality, it ought to be a single line of a fixed length. Maybe I've already described this well enough, but to put it another way: the length of each straight arm is reduced by a portion of the arc's length. Since the top die does not need to be in the center, the portion of the arc is not half but varies depending on which bottom die is closer.

I can't get my head wrapped around how to create nodes, but my hat is off to you for doing so. Because I enjoy making things and for my own education, I will continue to pursue this as a MoI script, but I strongly suspect your new node will be quite handy for those of us who fool with bending things. Well done Sir!

--Larry
  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:  Barry-H
11632.60 In reply to 11632.59 
Hi Larry,
try this version.
Set the bar datum to the left and bar length.
When bent the bar length should be maintained and a curve length value is used as a check.
Cheers
Barry
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
 From:  Larry Fahnoe (FAHNOE)
11632.61 In reply to 11632.60 
Hi Barry,

You nailed it! Now you're going to be guilty of encouraging a bunch of folks to try their hand at bending some metal.

--Larry
  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

 

 
 
Show messages:  1-2  3-22  23-42  43-61