morphogen.laser.patterns¶
Laser paths: the patterns of tracks that architecture a sheet.
A LaserPath is a sequence of Track s, polylines (mm) that the beams
follow in order, each with its beams (the upper one, and the lower one of a double-sided
treatment) and the pause that follows it (the cooling before the next track, at least
30 s between neighbouring tracks in Wang’s experiments). Coordinates are those of the
sheet: x along the tensile axis (the rolling direction), y across.
Generators (PATTERNS, make_pattern()), for a band [x0, x1] x [y0, y1]
(the tracks overhang the band along x by margin, the specimen being cut afterwards,
so that no track starts or stops in it):
straightcountparallel tracks atangle(degrees from x), atspacing(default: the band’s width overcount), centred;corrugatedcounttracksy = y_i + A sin(2π x/P + φ_i)(amplitudeA, the height of Wang et al.,periodP),phasethe shift between neighbours (0: in phase, 180: mirrored),shapesineortriangle(zigzag);fourierthe same with the waveform
Σ a_k sin(2πkx/P) + b_k cos(2πkx/P)ofcoefficients[[a1, b1], [a2, b2], ...]: the free shapes of an optimization;crossedtwo families of straight tracks at
±angle(a rhombic or square grid), the second family after the first, atspacingor at its ownspacing2(a rectangular grid: more tracks one way than the other);honeycombthe edges of hexagons of side
cell, drawn as zigzag rows and the rungs between them;spiralan Archimedean spiral
r = radius + pitch θ/2πaboutcenter(the centre of the band by default),turnsturns from the directionangle, counter-clockwise orclockwise: one track (the path of a crack to guide);polylinesgiven
tracks(lists of points).
Measures: length, time and energy of the path, the smallest radius of curvature
(LaserPath.min_radius()) and the smallest gap between distinct tracks
(LaserPath.min_gap()); LaserPath.to_gcode() writes it for a machine.
- class morphogen.laser.patterns.Track(points: ndarray, beam: Beam, bottom: Beam | None = None, pause: float = 30.0)[source]¶
Bases:
objectA polyline (n x 2, mm) followed by
beam(upper face) andbottom(lower face, or None), thenpauseseconds lasers off.- property length: float¶
- property time: float¶
Time with the lasers on (s).
- property energy: float¶
Incident energy of both beams (J).
- class morphogen.laser.patterns.LaserPath(tracks: list = <factory>)[source]¶
Bases:
objectTracks in the order of the treatment.
- property length: float¶
- property energy: float¶
- min_radius() float[source]¶
Smallest radius of curvature of the tracks (the circumradius of consecutive triplets of points; inf for straight tracks).
- min_gap(lo=None, hi=None) float[source]¶
Smallest distance between two distinct tracks (within the box
[lo, hi]if given): the tracks closer than their width overlap and temper each other.
- to_gcode(*, laser_on: str = 'M3', laser_off: str = 'M5') str[source]¶
The path as G-code (mm, mm/min): rapid moves to the starts of the tracks, the lasers on (
S: the power of the upper beam, W; a comment gives the lower one), linear moves at the speed of the track, the lasers off, a dwell for the pause.
- morphogen.laser.patterns.distance_to_polyline(points, polyline) ndarray[source]¶
Distance (mm) of points (n x 2) to a polyline (m x 2).
- morphogen.laser.patterns.straight(x0, x1, y0, y1, *, count=1, angle=0.0, spacing=None, offset=0.0, margin=5.0, alternate=True, beam, bottom=None, pause=30.0) LaserPath[source]¶
Parallel straight tracks (see the module).
- morphogen.laser.patterns.corrugated(x0, x1, y0, y1, *, count=1, amplitude=1.0, period=10.0, phase=0.0, shape='sine', spacing=None, offset=0.0, margin=5.0, resolution=24, alternate=True, beam, bottom=None, pause=30.0) LaserPath[source]¶
Corrugated tracks (see the module).
- morphogen.laser.patterns.fourier(x0, x1, y0, y1, *, count=1, period=10.0, coefficients=((1.0, 0.0),), phase=0.0, spacing=None, offset=0.0, margin=5.0, resolution=32, alternate=True, beam, bottom=None, pause=30.0) LaserPath[source]¶
Tracks of a Fourier waveform (see the module).
- morphogen.laser.patterns.crossed(x0, x1, y0, y1, *, angle=45.0, spacing=3.0, spacing2=None, offset=0.0, margin=5.0, alternate=True, beam, bottom=None, pause=30.0) LaserPath[source]¶
Two families of straight tracks at
±angle, the second atspacing2if given (see the module).
- morphogen.laser.patterns.chain_edges(vertices, edges) list[ndarray][source]¶
Polylines that cover the edges of a network once each: from an unused edge, a walk continues along the unused edge that turns the least, both ways, until none is left at its ends (few laser starts and stops).
- morphogen.laser.patterns.honeycomb(x0, x1, y0, y1, *, cell=3.0, angle=0.0, offset=0.0, margin=5.0, alternate=True, beam, bottom=None, pause=30.0) LaserPath[source]¶
The edges of regular hexagons of side
cell, two of their sides along x (turned byangledegrees), chained into continuous tracks (chain_edges()).
- morphogen.laser.patterns.spiral(x0, x1, y0, y1, *, center=None, radius=0.0, pitch=3.0, turns=2.0, angle=0.0, clockwise=False, resolution=0.2, margin=5.0, beam, bottom=None, pause=30.0) LaserPath[source]¶
An Archimedean spiral track (see the module), its points about
resolutionmm apart along it.
- morphogen.laser.patterns.polylines(tracks, *, beam, bottom=None, pause=30.0) LaserPath[source]¶
Tracks given as lists of points (see the module).
- morphogen.laser.patterns.PATTERNS = {'corrugated': <function corrugated>, 'crossed': <function crossed>, 'fourier': <function fourier>, 'honeycomb': <function honeycomb>, 'spiral': <function spiral>, 'straight': <function straight>}¶
Pattern generators of
make_pattern().
- morphogen.laser.patterns.clip_path(path: LaserPath, lo, hi) LaserPath[source]¶
The parts of the tracks inside the box
[lo, hi](a track that leaves and comes back splits into several).
- morphogen.laser.patterns.make_pattern(kind: str, band, *, beam, bottom=None, pause=30.0, rotation: float = 0.0, cover: bool = False, **params) LaserPath[source]¶
A pattern of
PATTERNS(orpolylines) over the band(x0, x1, y0, y1)(mm), its tracks followed bybeamandbottom.rotation(degrees) turns the pattern about the centre of the band: the specimen is then cut at-rotationfrom the axes of the pattern (the anisotropy of an architectured sheet, tested at 0°, 45° and 90°); the pattern is drawn on a square that covers the turned band, its families of tracks repeated at their spacing over it (the treated sheet), then clipped to the band and its margin — so is it unturned withcover(the periodic sheet around a cell,periodic).