Search Results for

    Show / Hide Table of Contents

    Class Shear

    Implements a shear transformation on a contiguous line of member particles.

    The handling with bonds can be configured. // TODO:

    The suboracle is called on its representative, but stores per-particle data via ParticleAttributes. An anchor particle (either explicitly provided or the representative) serves as the fixed reference point for the shear.

    Inheritance
    object
    Suboracle<Shear>
    Shear
    Namespace: AS2.Suboracles
    Assembly: .dll
    Syntax
    public class Shear : Suboracle<Shear>

    Constructors

    | Edit this page View Source

    Shear(Particle)

    Declaration
    public Shear(Particle rep)
    Parameters
    Type Name Description
    Particle rep

    Fields

    | Edit this page View Source

    anchor

    Declaration
    private ParticleAlgorithm anchor
    Field Value
    Type Description
    ParticleAlgorithm
    | Edit this page View Source

    clockwise

    Declaration
    private ParticleAttribute<bool> clockwise
    Field Value
    Type Description
    ParticleAttribute<bool>
    | Edit this page View Source

    count

    Declaration
    private ParticleAttribute<int> count
    Field Value
    Type Description
    ParticleAttribute<int>
    | Edit this page View Source

    releaseExpanded

    Declaration
    private ParticleAttribute<bool> releaseExpanded
    Field Value
    Type Description
    ParticleAttribute<bool>
    | Edit this page View Source

    round

    Declaration
    private ParticleAttribute<int> round
    Field Value
    Type Description
    ParticleAttribute<int>
    | Edit this page View Source

    startDir

    Declaration
    private ParticleAttribute<Direction> startDir
    Field Value
    Type Description
    ParticleAttribute<Direction>
    | Edit this page View Source

    stickEndHead

    Declaration
    private ParticleAttribute<bool> stickEndHead
    Field Value
    Type Description
    ParticleAttribute<bool>

    Methods

    | Edit this page View Source

    Init(List<Shear>, bool, int, ParticleAlgorithm, bool, bool)

    Initializes the suboracle for a new shear operation on a contiguous line of member particles. The start direction is automatically detected from the anchor's neighbors.

    Declaration
    public void Init(List<Shear> memberParticles, bool clockwise, int count = 1, ParticleAlgorithm anchor = null, bool stickEndHead = false, bool releaseExpanded = true)
    Parameters
    Type Name Description
    List<Shear> memberParticles

    The particles that are part of this suboracle instance.

    bool clockwise

    Whether the shear turns clockwise or counterclockwise.

    int count

    The number of shear steps to perform (each step rotates the direction by 60°).

    ParticleAlgorithm anchor

    Optional anchor particle; defaults to the representative.

    bool stickEndHead

    Whether the end head stays attached to its non-member neighbors.

    bool releaseExpanded

    Whether expanded particles release additional bonds to non-member neighbors.

    | Edit this page View Source

    OnActivate()

    Executes the next round of the shear transformation. Round 0: Expand every second particle along the line. Round 1: Contract the expanded particles.

    Declaration
    protected override bool OnActivate()
    Returns
    Type Description
    bool

    True if the shear operation is complete, false if more rounds are needed.

    Overrides
    Suboracle<Shear>.OnActivate()
    • Edit this page
    • View Source
    In this article
    Back to top AmoebotSim 2.0 Documentation v1.12
    Copyright © 2025 AmoebotSim 2.0 Authors
    Generated by DocFX