Shape Constructors

construct module provides functions for constructing and extracting parametric shapes. A surface can be constructed from curves and a volume can be constructed from surfaces. Moreover, a surface can be extracted to curves and a volume can be extracted to surfaces in all parametric directions.

Function Reference

geomdl.construct.construct_surface(*args, **kwargs)

Generates surfaces from curves.

Returns:NURBS surface
Return type:NURBS.Surface
geomdl.construct.construct_volume(*args, **kwargs)

Generates volumes from surfaces.

Returns:NURBS volume
Return type:NURBS.Volume
geomdl.construct.extract_curves(psurf)

Extracts curves from a surface.

Parameters:psurf (abstract.Surface) – input surface
Returns:extracted curves
Return type:dict
geomdl.construct.extract_isosurface(pvol)

Extracts the largest isosurface from a volume.

The following example illustrates one of the usage scenarios:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
from geomdl import construct, multi
from geomdl.visualization import VisMPL

# Assuming that "myvol" variable stores your spline volume information
isosrf = construct.extract_isosurface(myvol)

# Create a surface container to store extracted isosurface
msurf = multi.SurfaceContainer(isosrf)

# Set visualization components
msurf.vis = VisMPL.VisSurface(VisMPL.VisConfig(ctrlpts=False))

# Render isosurface
msurf.render()
Parameters:pvol (abstract.Volume) – input volume
Returns:isosurface (as a tuple of surfaces)
Return type:tuple
geomdl.construct.extract_surfaces(pvol)

Extracts surfaces from a volume.

Parameters:pvol (abstract.Volume) – input volume
Returns:extracted surface
Return type:dict