Model.line_trim_ends#

Model.line_trim_ends(collection, x1, y1, z1, x2, y2, z2, keep_original_lines)#

Trims given lines on input collection at the specified points. If the trimming locations are not exactly lying on a specific line, then the points on line closest to the given ones are used instead.

Parameters:
  • collection (Collection) – The collection containing the line entities to edit.

  • x1 (double) – The x component of the first trim point.

  • y1 (double) – The y component of the first trim point.

  • z1 (double) – The z component of the first trim point.

  • x2 (double) – The x component of the second trim point.

  • y2 (double) – The y component of the second trim point.

  • z2 (double) – The z component of the second trim point.

  • keep_original_lines (int) –

    0 - Do not keep

    1 - Keep

Example#

Trim the lines with IDs 10,20,30 from points closest to ( 4.5 , 6.7 , 8.9 ) to ( 0.1 , 0.2 , 0.3 ) and do not keep the original lines#
import hm
import hm.entities as ent

model = hm.Model()

model.line_trim_ends(
    collection=hm.Collection(model, ent.Line, [10, 20, 30]),
    x1=4.5,
    y1=6.7,
    z1=8.9,
    x2=0.1,
    y2=0.2,
    z2=0.3,
    keep_original_lines=0,
)