Show / Hide Table of Contents

Creating Intersection Curves

This example provides information on creating intersection curves between two bodies, and how to create a border from points. You can see the different bodies of the part in the Modeling browser tab.

Solution

  1. Create a Part object to contain the bodies and add it to the station.

    Part p = new Part();
    p.Name = "My_Advanced_Curves";
    station.GraphicComponents.Add(p);
    
  2. Create border around face

    • Create a box

      Matrix4 origin = new Matrix4(new Vector3(Axis.X), 0.0);
      Vector3 size = new Vector3(0.5, 0.5, 0.5);
      Body box = Body.CreateSolidBox(origin, size);
      box.Name = "Box";
      p.Bodies.Add(box);
      
    • Create the border curve around face

      Body b1 = Body.CreateBorderAroundFace(box.Shells[0].Faces[0]);
      b1.Name = "Face Border";
      p.Bodies.Add(b1);
      
  3. Create border from points

    • Create a Vector3 array of points

      Vector3 p1 = new Vector3(0.0, 0.0, 0.0);
      Vector3 p2 = new Vector3(0.5, 0.0, 0.0);
      Vector3 p3 = new Vector3(0.5, 0.5, 0.0);
      Vector3 p4 = new Vector3(0.5, 0.5, 0.5);
      Vector3[] points = new Vector3[4] { p1, p2, p3, p4 };
      
    • Create a border curve from points

      Body b2 = Body.CreateBorderFromPoints(box, points);
      b2.Name = "Border from Points";
      p.Bodies.Add(b2);
      
  4. Create an intersection curve

    • Create a solid sphere

      Body sphere = Body.CreateSolidSphere(new Vector3(0.25, 0.25, 0.25), 0.3);
      p.Bodies.Add(sphere);
      
    • Create an intersection curve from the box and the sphere

      Body intersectionCurve = Body.CreateIntersectionCurve(box, sphere);
      p.Bodies.Add(intersectionCurve);
      

Example

This example provides information on creating intersection curves.

Project.UndoContext.BeginUndoStep("BodyAdvancedCurves");
try
{
    Station station = Station.ActiveStation;

    // Create a part to contain the bodies.
    Part p = new Part();
    p.Name = "My_Advanced_Curves";
    station.GraphicComponents.Add(p);

    // Create border around face.
    // First create a box.
    Matrix4 origin = new Matrix4(new Vector3(Axis.X), 0.0);
    Vector3 size = new Vector3(0.5, 0.5, 0.5);
    Body box = Body.CreateSolidBox(origin, size);
    box.Name = "Box";
    p.Bodies.Add(box);

    // Then create the border curve.
    Body b1 = Body.CreateBorderAroundFace(box.Shells[0].Faces[0]);
    b1.Name = "Face Border";
    p.Bodies.Add(b1);

    // Create border from points.
    // Create an array of points of the box.
    Vector3 p1 = new Vector3(0.0, 0.0, 0.0);
    Vector3 p2 = new Vector3(0.5, 0.0, 0.0);
    Vector3 p3 = new Vector3(0.5, 0.5, 0.0);
    Vector3 p4 = new Vector3(0.5, 0.5, 0.5);
    Vector3[] points = new Vector3[4] { p1, p2, p3, p4 };
    Body b2 = Body.CreateBorderFromPoints(box, points);
    b2.Name = "Border from Points";
    p.Bodies.Add(b2);

    // Create Intersection Curve.
    // Create a SolidSphere.
    Body sphere = Body.CreateSolidSphere(new Vector3(0.25, 0.25, 0.25), 0.3);
    p.Bodies.Add(sphere);
    Body intersectionCurve = Body.CreateIntersectionCurve(box, sphere);
    p.Bodies.Add(intersectionCurve);

    // Create the same curve using the non static intersection curve method.
    Body intersectionCurve2 = box.CreateIntersectionCurve(sphere);
    p.Bodies.Add(intersectionCurve2);
}
catch
{
    Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
    throw;
}
finally
{
    Project.UndoContext.EndUndoStep();
}

Required Namespaces

ABB.Robotics.RobotStudio

ABB.Robotics.RobotStudio.Stations

ABB.Robotics.Math

See Also

  • Create Curves
  • Curve Manipulations
In this article
Back to top Copyright © 2025 ABB