Algo API

flatten_aspect_layers(flatten_result, layers)

Flatten aspect layers into the given aspect layer.

Parameters
  • flatten_result (AspectLayer) -- The layer which will contain the result of the given list of layers flatten.

  • layers (list(AspectLayer)) -- The list of aspect layers to flatten.

Raises
  • ReadOnlyError -- If Database is in read only mode.

  • ValueError -- If the list of aspect layers is empty.

  • ValueError -- If all the given layers are not in the same product.

merge_surfaces(leader, surfaces, exclude_seams=True)

Merge surfaces

Note

After the merge, the input surfaces are deleted. This function has no effects if surfaces is empty or only contains the leader.

Parameters
  • leader (Surface) -- The leader surface to use for the merge.

  • surfaces (list(Surface)) -- The list of surfaces to merge. The leader surface can be in the list or can be omitted.

  • exclude_seams (bool) -- Whether to exclude seam surfaces or surfaces containing seams. If False, these surfaces will be merged but the seam information will be lost.

Returns

The merged surface.

Return type

Surface

Raises
  • ReadOnlyError -- If Database is in read only mode.

  • ValueError -- If not enough surfaces to merge.

  • ValueError -- If a surface is not in the same model as the leader.

  • ValueError -- If the leader contains seams but exclude_seams is True.

render_lighting(database, remote=False)

Render lighting

Note

Render lighting for the current active model.

Note

Remote rendering is not available when using .p3d direct access.

Parameters
  • database (Database) -- Database.

  • remote (bool) -- Whether to use remote rendering or not.

Raises

ReadOnlyError -- If Database is in read only mode.

render_lighting_for_surfaces(layer, surfaces, remote=False)

Render lighting for the specified surfaces

Note

Render lighting for the current active model.

Note

Remote rendering is not available when using .p3d direct access.

Parameters
  • layer (LightingLayer) -- Lighting layer to render.

  • surfaces (list(Surface)) -- Surfaces to render lighting.

  • remote (bool) -- Whether to use remote rendering or not.

Raises

ReadOnlyError -- If Database is in read only mode.

split_surface(surface)

Split surface

Note

If the surface cannot be splited, an exception will be raised, otherwhise the input surface is deleted.

Parameters

surface (Surface) -- The surface to split.

Returns

The splited surfaces.

Return type

list(Surface)

Raises
stitch_surfaces(leader, surfaces)

Stitch surfaces

Note

After the stitch, the input surfaces are deleted. This function has no effects if surfaces is empty or only contains the leader.

Parameters
  • leader (Surface) -- The leader surface to use for the stitch.

  • surfaces (list(Surface)) -- The list of surfaces to stitch. The leader surface can be in the list or can be omitted.

Returns

The stitched surfaces.

Return type

list(Surface)

Raises
  • ReadOnlyError -- If Database is in read only mode.

  • ValueError -- If not enough surfaces to stitch.

  • ValueError -- If a surface is not in the same model as the leader.

unmerge_surface(surface)

Unmerge surface

Note

If the surface cannot be unmerged, an exception will be raised, otherwhise the input surface is deleted.

Parameters

surface (Surface) -- The surface to unmerge.

Returns

The list of surfaces resulting of the surfaces unmerge.

Return type

list(Surface)

Raises