FormDiagram.from_lines

classmethod FormDiagram.from_lines(lines, delete_boundary_face=True, precision=None, **kwargs)

Construct a FormDiagram from a list of lines described by start and end point coordinates.

Parameters
  • lines (list) – A list of pairs of point coordinates.

  • delete_boundary_face (bool, optional) – Set True to delete the face on the outside of the boundary, False to keep it. Default is True.

  • precision (str, optional) – The precision of the geometric map that is used to connect the lines. If not specified, the global precision stored in compas.PRECISION will be used.

Returns

FormDiagram – A FormDiagram object.

Examples

>>> import compas
>>> from compas.files import OBJ
>>> from compas_tna.diagrams import FormDiagram
>>> obj = OBJ(compas.get('lines.obj'))
>>> vertices = obj.parser.vertices
>>> edges = obj.parser.lines
>>> lines = [(vertices[u], vertices[v]) for u, v in edges]
>>> form = FormDiagram.from_lines(lines)