topoptlab.draw_functions module

topoptlab.draw_functions.hinged_support(x0: float, y0: float, ax: Axes, fig: Figure, triangle_width: float = 1.0, radius: float = 0.08) None[source]

Draw a hinged support for a sketch.

Parameters:
  • x0 (float) – x coordinate of supported point.

  • y0 (float) – y coordinate of supported point.

  • num_coils (int) – number of coils

  • coil_width (float) – coil width

  • coil_length (float) – coil length

  • points_per_coil (int) – points drawn per coil

Return type:

None

topoptlab.draw_functions.spring(x0: float, y0: float, num_coils: int = 3, coil_width: float = 0.02, coil_length: float = 0.4, points_per_coil: int = 9) Tuple[ndarray, ndarray][source]

Draw a spring for a sketch.

Parameters:
  • x0 (float) – x coordinate of bottom of spring.

  • y0 (float) – y coordinate of bottom spring.

  • num_coils (int) – number of coils

  • coil_width (float) – coil width

  • coil_length (float) – coil length

  • points_per_coil (int) – points drawn per coil

Returns:

  • x (np.ndarray shape (num_coils * points_per_coil + 1)) – x coordinates of spring.

  • y (np.ndarray shape (num_coils * points_per_coil + 1)) – y coordinates of spring.