silhouette points of planar curve
 1-20  21-34

Next
 From:  pressure (PEER)
11213.1 
I'm looking for a way to find the silhouette points of a planar curve when that curve is viewed from a point in the plane of the curve. In other words, looking at the curve edge-on so that it looks like a straight line I need the points on the curve that correspond with the ends of the straight line.

I want to do this both for parallel projection and projection through a point.

For parallel I tried using the BoundingBox command and Construct > Curve > Isect between the box and the curve. There's some inaccuracy though and so I end up with a couple separated points in the zone where the curve is tangent to its bounding box.

For projection through a point I can find the points manually by drawing a line through the point and then rotating the line around the point until it snaps onto a Tan snap point on the curve.

A similar manual technique works for parallel projection. I copy the curve and paste it along the view direction. Then I draw a line between the first curve and the second curve using Tan/Tan snapping. The point where the line snaps to the first curve is a silhouette point.

Finding the silhouette points is just one step in a long process that involves many curves, so I'm looking for a method that can be automated.

- Peer
  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
11213.2 In reply to 11213.1 
hi Peer, can you please post an example file with example input curves and an approximation of desired output?

That would make it easier to make sure I understand.

- 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:  pressure (PEER)
11213.3 In reply to 11213.2 
Hi Michael,

Here's an example of the parallel case with projection along the red arrow. There's a point object at each silhouette point. The ones I really want are the "outline" points in green. The blue point is also a silhouette point, but I'll need to filter that type out.



Same deal for the perspective projection case, but there's another silhouette point of the type that I don't want:



I'll also need to be able to handle the case where a silhouette point is an endpoint of the curve, like how Construct > Curve > Silhou has an option for including edges, but here I'd be including endpoints.

- Peer

  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:  pressure (PEER)
11213.4 In reply to 11213.2 
I don't actually need the flexibility I implied in my last message. I'll only ever want the outline points of which there should always be exactly 2. Each of the outline points may fall along the curve, or may be at an endpoint. Here's another example showing the 2 points that I want where one of them is at an endpoint:



- Peer

  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
11213.5 In reply to 11213.3 
Hi PEER,

For the parallel projection, place a Plane downstream of your curve, (in the projection direction).
Use Construct > Curve > Project to project your curve to the plane, as a line.
Draw lines from the two endpoints of said line, back upstream to intersect your curve, and perform Intersect to get the two points.

- 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
11213.6 
Can the Perspective Projection of your curve be done onto a Plane? (To form a line on the Plane...?)

Then the endpoints of the resulting line on a Plane drawn as lines back to the perspective point, and the intersection with your curve done???

Last years script:
https://moi3d.com/forum/index.php?webtag=MOI&msg=10807.7

- Brian

The Plane could be to the left, center between curve and point, or to the right?
  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
11213.7 
Can the script "ViewRaysThroughPoints2" be modified to project many arrayed points on the Curve, Through the projection point, onto a Plane? With the result a line on the Plane?

- 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
11213.8 In reply to 11213.5 
@ Brian - re:

> Use Construct > Curve > Project to project your curve to the plane, as a line.

The tricky part is that although it will have the shape of a line, it is going to be a closed curve that's all squashed down and running back over itself. So it's not going to have 2 endpoints at the extrema like you would need. If I have understood.

@ Peer - thanks for the further examples. I don't think there is any way to automate this currently but I'll see about adding a method on curves to collect all the locations where there is a common tangent to a point or direction. Then to weed out the internal ones you could make a line and intersect it with the curve, if there is an intersection other than at the tangent point then you would skip it. And you'd do a similar line intersection test for the endpoints of an open curve as well.

- 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:  pressure (PEER)
11213.9 In reply to 11213.5 
Thank you Brian! Construct > Curve > Project is just the ticket for the parallel case.

Re:
> Can the script "ViewRaysThroughPoints2" be modified to project many
> arrayed points on the Curve, Through the projection point, onto a
> Plane? With the result a line on the Plane?

I need this to be pretty accurate, so if I were going that route it would probably have to be iterative rather than a uniform array. I worry that doing that well might be complicated. And it also seems like reinventing the wheel since the Tan points from the snapping mechanism when drawing a line from the point to the curve are basically what I'm trying to get. I just haven't figured out a way to get them using a script without manually moving the mouse around and actually snapping to them.

- Peer
  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:  pressure (PEER)
11213.10 In reply to 11213.8 
Hi Michael,

I guess we were typing at the same time.

Re:
> although it will have the shape of a line, it is going to be a
> closed curve that's all squashed down and running back over itself.

That's kind of what I was expecting and so didn't try it, but having actually tried it now that's not what I see happening. Like if I project the edge view of a circle onto a plane I get an open curve with endpoints at the right locations. It's not a nice simple line with only 2 control points, but it does have endpoints where I need them.

Re:
> I'll see about adding a method

Looking forward to it! Sounds cleaner for the parallel case too.

Re:
> Then to weed out the internal ones you could make a line and intersect
it with the curve, if there is an intersection other than at the tangent
point then you would skip it.

So draw a line through the point along the projection ray direction and verify that it only intersects the curve at that one point. I like it.

- Peer
  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
11213.11 In reply to 11213.10 
Hi Peer,

re:
> Like if I project the edge view of a circle onto a plane I get an open curve with
> endpoints at the right locations. It's not a nice simple line with only 2 control
> points, but it does have endpoints where I need them.

For the case of a circle it happens to have control points directly on the curve at the quadrants.

In a more general case like this it won't have any points like that:




The squashed curve has degenerate first derivatives with zero magnitude at the folding spots which tends to throw a monkey wrench into various numeric analysis stepping mechanisms.

It would probably be good to handle this case better in the project command by finding these spots before the projection and splitting it up at those points.


> So draw a line through the point along the projection ray direction and
> verify that it only intersects the curve at that one point.

Yup, it's like a ray fire visiblity test.

- MIchael
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
11213.12 In reply to 11213.8 
Thank you Michael for explaining about the squashed curve. I imagine the squashed curve would not be well behaved with other commands...

The Perspective Projection reminds me of stereoscopic projection with a sphere, and also the "beachline" with voronoi.

In my two brief attempts, the Moi Silhouette command attempt in the plane of the curve, did not work. I wondered if it uses some different algorithm than the Moi Project command. Would a more conventional use of the Moi Silhouette command ever produce squashed curves?

The Moi Silhouette command seems to be an orthographic projection ?
Same for Moi Project command?

- 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
11213.13 In reply to 11213.12 
Hi Brian,

re:
> In my two brief attempts, the Moi Silhouette command attempt in the plane of the curve, did not work.

The Silhouette command only works on surfaces or solids, not on curves.


> I wondered if it uses some different algorithm than the Moi Project command.

Silhouette is pretty different than Project, Silhouette steps along a surface tracing out a curve where surface normals are changing from pointing towards the eye point to pointing away from the eye point.

So for example a surface like this:



Silhouette will generate this:




> Would a more conventional use of the Moi Silhouette command ever produce squashed curves?

No I don't think it would generate squashed curves.


> The Moi Silhouette command seems to be an orthographic projection ?

You tell it which viewport you want to use and it uses whatever projection that view is using. Which will be orthographic if it's the Top/Front/Right view or if it's the 3D view it depends on if Options > View > 3D view projection = "Perspective" or "Parallel".

- 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
11213.14 In reply to 11213.4 
hi Peer, so I guess that a ray fire / intersect method isn't going to be quite right for open curves.

Because like this:



So maybe what you need is to project each candidate point, the tangent points and the end points, onto a line that is orthogonal to the projection direction and take the minimum and maximum distances along that line:



- 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:  pressure (PEER)
11213.15 In reply to 11213.14 
Hi Michael,

Thank you for continuing to think about this. Not sure I get the part about minimum distances, but finding the pair of points with the maximum distance in the projection makes sense.

- Peer
  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
11213.16 
Just a quick note, very limited testing:

If the closed curve is extruded, the Moi Silhouette command in Right view yields the two extreme points, (on short lines), plus others, for parallel case.

In 3D view, several different point, (on short lines) are available. (I guess due to camera or some other point) For point case? Need to Identify "camera" focus point? And move it to projection point?
ViewRaysThroughPoints2 script finds a "focal" point.
I do not know how to change camera eye point. There is a camera script.

(Maybe a waste of time:-) Maybe Moi Silhouette command contains useful code that could be modified?

- Brian

EDITED: 22 Sep 2023 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:  MO (MO_TE)
11213.17 
Hi Peer
I hope I understand you right.
I've made this node to find highest and lowest points on a curve (according to the z axis), using its bounding box.
It works on curves drawn in front viewport,
But I guess you can modify its algorithm to use inside a script.


  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
11213.18 In reply to 11213.15 
Hi Peer,

re:
> Not sure I get the part about minimum distances

Just that usually when a point is projected onto a line you'll produce the signed distance for the position on the line. If you get that then you want the minimum and maximum of those.

- 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)
11213.19 
Maybe related to your subject...
A little trick for finding the Apex of something!
(the outermost point of something)

Draw a small vertical line around the supposed point!

Then draw a Point coming from the middle of this vertical using the "Help Lines": Perp / Perp

---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel Gallery
  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
11213.20 In reply to 11213.17 
Hi Mo,
don't have the PTS2pts node can you post it please.
Cheers
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
 

Reply to All Reply to All

 

 
Show messages:  1-20  21-34