pb

pb sets coordinates of the vertices in a region of the open part.

Syntax

pb imin jmin kmin imax jmax kmax component value [ value ... ]
  • imin to kmax: a region of reduced indices. A 0 in a minimum means the first reduced index of its direction and a 0 in a maximum the last. The concepts chapter explains regions.
  • component: one of x, y, z, xy, xz, yz or xyz. It names the coordinates to set.
  • value: one real for each letter of component: one for x, y or z, two for xy, xz or yz, three for xyz. The values are in the order of the letters.

What it does

pb sets the named coordinates of every vertex in the region. The coordinates that component does not name keep their values. Vertices are the control points of the part, reached by reduced indices. The nodes between them follow in later steps. In a cylinder part the three coordinates are radius, angle in degrees and height.

When James applies it

Step 1iii of the hierarchy: James places vertices before any edge is attached to a curve and before any face is projected. Within the step, James applies the vertex commands in the order the script wrote them, each on top of what the earlier ones left, so a later pb on the same vertex wins. pb is legal only in the Part phase.

Rules James adds

  • Several commands that reach the same vertex are applied in input order. A later command’s effect on a coordinate replaces an earlier one’s.
  • A vertex that a later step projects away from its pb position is not held there. pb is a starting position, not a constraint.

Diagnostics

  • E0500: a reduced index lies outside the part.
  • E0501: component is not one of the seven words.
  • E0502: the number of values does not fit component.
  • E0106: a minimum is larger than its maximum.

Example

The script tests/corpus/041-pb-two-same-vertex/input.tg, which make test runs:

block 1 2;1 2;1 2;0 1;0 1;0 1;
pb 1 1 1 1 1 1 x 1.0
pb 1 1 1 1 1 1 x 2.0
endpart

Both commands name vertex (1, 1, 1). James keeps both in input order in the IR, so the vertex ends at x = 2. That is past the vertex at x = 1 beside it, and James warns that one element has a negative Jacobian. James prints the warning in tests/corpus/041-pb-two-same-vertex/expected.diag.txt:

input.tg:1:1: warning: part #0 has 1 element with a negative Jacobian
james: 0 errors, 1 warning

See also

  • mb: adds an offset in place of a value.
  • mbi: mb with a progression.
  • q: copies one vertex onto another.
  • ilin: interpolates vertices from the region’s boundary.
  • Concepts: reduced indices and regions.
  • Shaping: placing vertices.

James 0.3.1.

This site uses Just the Docs, a documentation theme for Jekyll.