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.
Namespace: AS2.Suboracles
Assembly: .dll
Syntax
public class Shear : Suboracle<Shear>
Constructors
| Edit this page View SourceShear(Particle)
Declaration
public Shear(Particle rep)
Parameters
| Type | Name | Description |
|---|---|---|
| Particle | rep |
Fields
| Edit this page View Sourceanchor
Declaration
private ParticleAlgorithm anchor
Field Value
| Type | Description |
|---|---|
| ParticleAlgorithm |
clockwise
Declaration
private ParticleAttribute<bool> clockwise
Field Value
| Type | Description |
|---|---|
| ParticleAttribute<bool> |
count
Declaration
private ParticleAttribute<int> count
Field Value
| Type | Description |
|---|---|
| ParticleAttribute<int> |
releaseExpanded
Declaration
private ParticleAttribute<bool> releaseExpanded
Field Value
| Type | Description |
|---|---|
| ParticleAttribute<bool> |
round
Declaration
private ParticleAttribute<int> round
Field Value
| Type | Description |
|---|---|
| ParticleAttribute<int> |
startDir
Declaration
private ParticleAttribute<Direction> startDir
Field Value
| Type | Description |
|---|---|
| ParticleAttribute<Direction> |
stickEndHead
Declaration
private ParticleAttribute<bool> stickEndHead
Field Value
| Type | Description |
|---|---|
| ParticleAttribute<bool> |
Methods
| Edit this page View SourceInit(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. |
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. |