getIsG2Edge scripting

Next
 From:  pressure (PEER)
11169.1 
Is there a way to check with a script if the faces on either side of an edge meet with the same curvature like how edge.getIsTangentEdge() checks if the faces are G1 at the edge?

- 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
11169.2 In reply to 11169.1 
Hi Peer,

re:
> Is there a way to check with a script if the faces on either side of an edge meet with the same curvature
> like how edge.getIsTangentEdge() checks if the faces are G1 at the edge?

Sorry no there isn't any packaged up way to determine this from script.

There is probably enough information exposed by face.dropPoint, face.evaluateNormal, face.evaluate1stDerivatives, and face.evaluate2ndDerivatives that a script could use to figure it out. But if the edge is not an isocurve you'll need to compute the normal curvature:

- 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)
11169.3 In reply to 11169.2 
Thanks for the fast reply Michael. I'll try rolling my own.

- 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)
11169.4 In reply to 11169.2 
Hi Michael,

Should I literally construct a plane orthogonal to the edge, construct a first intersection curve between this plane and the first face, construct a second intersection curve between this plane and the second face, and finally verify that the curves are G2 by running curve.evaluateCurvature() on each and comparing the 0th, 1st, and 2nd derivative vectors?

Or is there a nicer way to do this when the edge isn't an isocurve of both faces?

- Peer

EDITED: 2 Oct 2023 by 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
11169.5 In reply to 11169.4 
Hi Peer, no you would probably need to evaluate the "Normal curvature" of the surface.
https://mathworld.wolfram.com/NormalCurvature.html

That's the surface curvature in a specific direction, you would get a perpendicular direction from the edge by cross product of the edge tangent and surface normal.

There's an implementation here:
https://github.com/mcneel/opennurbs/blob/8.x/opennurbs_math.cpp
Look for ON_NormalCurvature() :

ON_NormalCurvature(
const ON_3dVector& S10, const ON_3dVector& S01,
const ON_3dVector& S20, const ON_3dVector& S11, const ON_3dVector& S02,
const ON_3dVector& UnitNormal, const ON_3dVector& UnitTangent )

The parameters S10, S01, S20, S11, S02 that ON_NormalCurvature takes are returned by face.evaluate2ndDerivatives(), which returns a list containing valuesfor point, du, dv, duv, duu, dvv.

I'll see about adding in a surface normal curvature evaluator for scripting.

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

Thanks for explaining what needs to be done, providing an example of how to do it, and offering to add a method for this!

I'll probably wait for you since I don't really understand the normal curvature calculation.

- 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
 

Reply to All Reply to All