pymoto.OverhangFilter

class pymoto.OverhangFilter(domain: VoxelDomain, direction=(0.0, 1.0, 0.0), overhang_angle: float = 45.0, xi_0: float = 0.5, p: float = 40.0, eps: float = 0.0001, nsampling: int = 8)

Implementation of overhang filter by Langelaar (2016, 2017)

It proceeds layer by layer through the entire domain. For each element in the current layer, the maximum printable density is determined by a smooth maximum of the supporting elements \(s_i = \text{smax}(\mathbf{y}_\text{supp})\). Then, the final printed density value is obtained by a smooth minimum operation of the desired density \(x_i\) and the maximum printable density \(x_i\) as \(y_i = \text{smin}(x_i, s_i)\).

Input Signal:
  • x: The unfiltered field \(\mathbf{x}\)

Output Signal:
  • y: Filtered field \(\mathbf{y}\), without overhangs

References

  • Langelaar, M. (2017). An additive manufacturing filter for topology optimization of print-ready designs. Structural and Multidisciplinary Optimization, 55(3), 871-883. doi: 10.1007/s00158-016-1522-2

  • Langelaar, M. (2016). Topology optimization of 3D self-supporting structures for additive manufacturing. Additive Manufacturing, 12, 60-70. doi: 10.1016/j.addma.2016.06.010

  • Delissen, A., et al. (2022). Realization and assessment of metal additive manufacturing and topology optimization for high-precision motion systems. Additive Manufacturing, 58, 103012. doi: 10.1016/j.addma.2022.103012

__init__(domain: VoxelDomain, direction=(0.0, 1.0, 0.0), overhang_angle: float = 45.0, xi_0: float = 0.5, p: float = 40.0, eps: float = 0.0001, nsampling: int = 8)

Initialize overhang filter modulue

Parameters:
  • domain (pymoto.VoxelDomain) – The (finite-element) domain

  • direction (tuple, optional) – Print direction as array or string, e.g. [0, -1] (in 2D) or "y-" for negative y direction. Currently, only directions aligned with one of the Cartesian axes are supported. Default is [0, 1, 0]

  • overhang_angle (float, optional) – Overhang angle in degrees (measured from print direction vector)

  • xi_0 (float, optional) – Density value for which zero overshoot is required ( 0 <= xi_0 <= 1 ). Default is 0.5

  • p (float, optional) – Exponent of the smooth maximum function ( p > 0 ). Higher p increases accuracy, but reduces smoothness. Default is 40.0

  • eps (float, optional) – Smooth minimum regularization parameter ( eps >= 0 ). Lower eps increases accuracy, but reduces smoothness. Default is 1e-4

  • nsampling (int, optional) – Number of sampling points on the perimeter of the cone. In 2D the value is clipped to 2.

Methods

__init__(domain[, direction, ...])

Initialize overhang filter modulue

connect(sig_in[, sig_out])

Connect without automatic adding to a function network

get_input_sensitivities([as_list])

get_input_states([as_list])

get_output_sensitivities([as_list])

get_output_states([as_list])

reset()

Reset the state of the sensitivities (they are set to zero or to None)

response()

Calculate the response from sig_in and output this to sig_out

sensitivity()

Calculate sensitivities using backpropagation

set_parameters(typ)

Set the internal smooth-maximum and smooth-minimum parameters according to the values in Langelaar, 2017

setup_cone()

Attributes

direction

n_in

Get the number of input signals

n_out

Get the number of output signals

sig_in

sig_out

property direction
set_parameters(typ: dtype)

Set the internal smooth-maximum and smooth-minimum parameters according to the values in Langelaar, 2017

Parameters:

typ – The numeric type used in the calculations

class Indexer(ndim=3, base_val=0, offset=None)
connect(sig_in: Signal | Iterable[Signal], sig_out: Signal | Iterable[Signal] = None)

Connect without automatic adding to a function network

get_input_sensitivities(as_list=False)
get_input_states(as_list=False)
get_output_sensitivities(as_list=False)
get_output_states(as_list=False)
property n_in: int

Get the number of input signals

property n_out: int

Get the number of output signals

Note: Cannot be used in the initial __call__()

reset()

Reset the state of the sensitivities (they are set to zero or to None)

response()

Calculate the response from sig_in and output this to sig_out

sensitivity()

Calculate sensitivities using backpropagation

Based on the sensitivity we get from sig_out, reverse the process and output the new sensitivities to sig_in

sig_in: List = None
sig_out: List = None
setup_cone() ndarray