Product help with community knowledge

Page statistics

287 views1 edit(s)5753 characters(s) Page last modified 18:13, 15 Jan 2013 by contentconnector

trim()

1. 1. Synopsis
2. 2. Syntax
3. 3. Example 1
4. 4. Example 2
5. 5. Example 3

Synopsis

Returns the trimming parameter on part1 where it is intersected by part2. onRight? determines which of two possible intersections is used. For Arc to Arc intersections, it picks the one to the "right" as one travels from the first to the second, where the normal of the first is used to disambiguate. For Arc to Line intersections, it picks the parameter nearest the start of the line. For Line to Line intersections, onRight? is not used (but must be supplied). Part1 and Part2 must handle either the Arc or Line protocols (supplied by ArcMixin or LineMixin, respectively).

At present, the only support for Designs incorporating ArcMixin and LineMixin are IvSketchArc and IvSketchLine, respectively.

Syntax

```trim ( part1 As Part, _
part2 As Part, _
onRight? As Boolean ) As Number ```
Argument Type Description
part1 Part The first part to intersect. The part must be a kind of ArcMixin or LineMixin.
part2 Part The second part to intersect. The part must be a kind of ArcMixin or LineMixin.
onRight? Boolean Determines which of two possible intersections is selected. See the synopsis for details.

Example 1

Given the following definitions (inside a sketch):

```Child IvSketchArc1 As IvSketchArc
center = Point(0,0,0)
End Child

Child IvSketchArc2 As IvSketchArc
center = Point(1,0,0)
End Child

Child IvSketchLine1 as IvSketchLine
thruPoint1 = IvSketchArc1.Center
thruPoint2 = IvSketchArc2.Center + Vector(5,0,0)
End Child
Child IvSketchLine2 as IvSketchLine
thruPoint1 = Point(0.5,2,0)
thruPoint2 = Point(0.5-2,0)
End Child ```
```Intent >trim(IvSketchArc1, IvSketchArc2, True)
--> 313.432536 ```

Example 2

Using the same definitions as Example 1

```Intent >trim(IvSketchArc1, IvSketchLine1, True)
--> 75.522487```

Example 3

Using the same definitions as Example 1

```Intent >trim(IvSketchLine1, IvSketchLine2, True)
--> 0.5```