Simcenter 3D Solutions Creating an Intersection Point of Two Curves using NX Open

2023-08-18T12:19:00.000-0400
Simcenter 3D

Summary

Using the CreatePoint function from the Point Collection using two curves can produce unexpected results.


Details

NXOpen.PointNXOpen.PointCollection.CreatePoint(NXOpen.IBaseCurvecurve1
   NXOpen.IBaseCurvecurve2
   NXOpen.PointhelpPt1
   NXOpen.PointhelpPt2
   NXOpen.SmartObject.UpdateOptionupdateOption
  )  

Case 1
Point3d pt3d_1 = new Point3d(0.0, 0.0, 0.0);
Point3d pt3d_2 = new Point3d(3.0, 3.0, 3.0);
Point3d pt3d_3 = new Point3d(2.0, 0.0, 0.0);
Point3d pt3d_4 = new Point3d(2.0, 3.0, 3.0);

Point point_1 = workPart.Points.CreatePoint(pt3d_1);
Point point_2 = workPart.Points.CreatePoint(pt3d_2);
Point point_3 = workPart.Points.CreatePoint(pt3d_3);
Point point_4 = workPart.Points.CreatePoint(pt3d_4);

Line line_12 = workPart.Curves.CreateLine(point_1, point_2);
Line line_34 = workPart.Curves.CreateLine(point_3, point_4);
Point answerPt = workPart.Points.CreatePoint(line_12, line_34, nullPt, nullPt, SmartObject.UpdateOption.WithinModeling);
Produces the expected point at coordinates [ 2.0, 2.0, 2.0 ] because the line segments intersect in 3D space

Case 2
Point3d pt3d_5 = new Point3d(0.0, 0.0, 0.0);
Point3d pt3d_6 = new Point3d(1.0, 1.0, 1.0);
Point3d pt3d_7 = new Point3d(2.0, 0.0, 0.0);
Point3d pt3d_8 = new Point3d(2.0, 1.0, 1.0);

Point point_5 = workPart.Points.CreatePoint(pt3d_5);
Point point_6 = workPart.Points.CreatePoint(pt3d_6);
Point point_7 = workPart.Points.CreatePoint(pt3d_7);
Point point_8 = workPart.Points.CreatePoint(pt3d_8);

Line line_56 = workPart.Curves.CreateLine(point_5, point_6);
Line line_78 = workPart.Curves.CreateLine(point_7, point_8);
Point answerPt = workPart.Points.CreatePoint(line_56, line_78, nullPt, nullPt, SmartObject.UpdateOption.WithinModeling);
Throws an exception.  Even though the projected lines of these segments intersect, the actual segments do not intersect.

The workaround is shown in the next case.

Case 3
Point3d pt3d_5 = new Point3d(0.0, 0.0, 0.0);
Point3d pt3d_6 = new Point3d(1.0, 1.0, 1.0);
Point3d pt3d_7 = new Point3d(2.0, 0.0, 0.0);
Point3d pt3d_8 = new Point3d(2.0, 1.0, 1.0);

Point point_5 = workPart.Points.CreatePoint(pt3d_5);
Point point_6 = workPart.Points.CreatePoint(pt3d_6);
Point point_7 = workPart.Points.CreatePoint(pt3d_7);
Point point_8 = workPart.Points.CreatePoint(pt3d_8);

InfiniteLine line_9 = workPart.Curves.CreateInfiniteLine(pt3d_5, pt3d_6);
InfiniteLine line_10 = workPart.Curves.CreateInfiniteLine(pt3d_7, pt3d_8);
Point answerPt = workPart.Points.CreatePoint(line_9, line_10, nullPt, nullPt, SmartObject.UpdateOption.WithinModeling);
Produces the expected point at coordinates [ 2.0, 2.0, 2.0 ], though the segments do not intersect, using an infinite lines using the segment values produces the desired value.



 

KB Article ID# KB000121584_EN_US

Contents

SummaryDetails

Associated Components

Acoustics Additive Manufacturing Assembly FEM Correlation and Updating Durability Electromagnetics (High Frequency) Electromagnetics (Low Frequency) Flexible Pipe Laminate Composites Margin of Safety Motion Multiphysics NX Open Nonlinear Optimization Pre/Post Response Dynamics Rotor Dynamics Samcef Environment Simulation Process Management Thermal / Flow