bertinireal.surface

Python libraries used: numpy, trimesh, copy, os, math

platform

Unix, Windows

synopsis

This module contains Surface and Piece types.

class surface.Piece(indices, surface)

Create a Piece object of a surface. A surface can be made of 1 piece or multiple pieces.

centroid()

Compute the centroid of each seperate piece

is_compact()

Check whether a piece is: (1) compact (no edges touch the bounding sphere) (2) non-compact (at least 1 edge touches bounding sphere)

Examples: sphere: (1 piece) - compact

dingdong: (2 pieces) - one compact, one not compact

octdong: (2 pieces) - both compact

whitney: (2 pieces) - both non-compact paraboloid: (1 piece) - non compact

point_singularities()

Compute singularity points from a Piece object

Return type

A list of indices of point singularities

class surface.Surface(directory, is_embedded=False, embedded_into=None)

Create a Surface object (Child class of Decomposition)

Parameters

Decomposition – Decomposition data from decomp file

cannot_possibly_meet(f, g)

Check whether faces f and g meet

Parameters
  • f – Current face

  • g – Other face

Return type

Return True if f and g meet, else False

check_data()

Check data

export_raw(which_faces=None, basename='br_surface_raw', autoname_using_folder=False, file_type='stl')

Export raw decomposition of surfaces to OBJ

export_smooth(which_faces=None, basename='br_surface_smooth', autoname_using_folder=False, file_type='stl')

Export smooth decomposition of surfaces to OBJ

faces_meet_at_bottom(f, g)

Check whether faces f and g nonsingularly connected at bottom

Parameters
  • f – Current face

  • g – Other face

Return type

Return True if f and g nonsingularly connected at bottom, else False

faces_meet_at_left(f, g)

Check whether faces f and g nonsingularly connected at left

Parameters
  • f – Current face

  • g – Other face

Return type

Return True if f and g nonsingularly connected at left, else False

faces_meet_at_right(f, g)

Check whether faces f and g nonsingularly connected at right

Parameters
  • f – Current face

  • g – Other face

Return type

Return True if f and g nonsingularly connected at right, else False

faces_meet_at_top(f, g)

Check whether faces f and g nonsingularly connected at top

Parameters
  • f – Current face

  • g – Other face

Return type

Return True if f and g nonsingularly connected at top, else False

faces_nonsingularly_connect(f, g)

Check whether faces f and g are nonsingularly connected

Parameters
  • f – Current face

  • g – Other face

Return type

Return True if f and g are nonsingularly connected, else False

faces_nonsingularly_connected(seed_index)

Compute the faces that are nonsingualrly connected

Parameters

seed_index – Index of seed

Return type

Two lists containing indices of connected and unconnected faces

find_connected_faces(current)

Find connected faces from current face

Parameters

current – Current face

Return type

List containing indices of connected faces

gather_curves(directory)

Gather the curves of surface

Parameters

directory – Directory of the surface folder

gather_faces(directory)

Gather the faces of surface

Parameters

directory – Directory of the surface folder

gather_surface_samples(directory)

Gather the surface samples of surface

Parameters

directory – Directory of the surface folder

is_edge_degenerate(e)

Check if critical point slices are degenerate (one of the endpoints is also the middle point)

Parameters

e – Critical point slices

Return type

Return True if e is degenerate

parse_surf(directory)

Parse and store into surface data

Parameters

directory – Directory of the surface folder

separate_into_nonsingular_pieces()

Separate a surface into nonsingular pieces

solidify_raw(distance=0.1, which_faces=None, basename='br_surface_solidified_raw', autoname_using_folder=False, file_type='stl')

Solidify raw version of surface.

Default format is stl. Also can do obj.

solidify_smooth(distance=0.1, which_faces=None, basename='br_surface_solidified_smooth', autoname_using_folder=False, file_type='stl')

Solidify smooth version of surface. Requires that the surface has been sampled using sampler

Default format is stl. Also can do obj.

write_piece_data()

“Opens and edits current scad data to set the orientation and location of a plug and socket

surface.copy_all_scad_files_here()

copy all source .scad files provided in bertini_real to the current directory