Model.lines_approximate#

Model.lines_approximate(collection, type, reserved1, reserved2)#

Simplifies curved free lines.

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

  • type (int) –

    1 - Each curved line will be replaced with a parabola (2nd degree) that has the same end points as the line, and is closest to it.

    2 - Each curved line will be simplified by removal of all internal knots but one (known as Bezier simplification).

  • reserved1 (int) – Reserved for future use. Must be set to 0.

  • reserved2 (double) – Reserved for future use. Must be set to 0.

Example#

Simplify the lines with IDs 1 and 2 by using Bezier simplification#
import hm
import hm.entities as ent

model = hm.Model()

model.lines_approximate(
    collection=hm.Collection(model, ent.Line, [1, 2]), type=2, reserved1=0, reserved2=0
)