patch

patch is meant to attach the four edges of one face to the four sides of a surface and then project the face. In this version of James it is read and checked, and the engine refuses it for every surface James has.

Syntax

patch imin jmin kmin imax jmax kmax surface

The first six numbers are a region, as for lin. The region must be one face. surface is the number of a surface that sd defines.

What it does

patch works for a surface with four sides, such as a bounded patch of a design model. None of the six kinds that James defines has four sides: a plane, a cylinder, a cone and a sphere are unbounded, a composite has no sides of its own, and a revolved curve has two rims. When the engine meets a patch, it stops with an error that names the surface and its kind. The compatibility chapter lists the command and says what a later version adds.

When James applies it

The IR stores patch for steps 2 and 6, when the edges are attached and then projected. In this version the engine refuses it before either runs. patch is legal only in the Part phase. James refuses it in the Control and Merge phases (E0412).

Rules James adds

  • A region that is not a face is an error (E0802). The message names what the region is: a vertex, an edge or a block.
  • A surface number that nothing defines is an error (E0800).
  • For a valid face and a defined surface the engine refuses with patch names surface #0, a plane, which has no four sides in this version of James, and the run exits with 2. The count starts at 0 in the order of definition, so the first sd is surface #0 whatever number it carries.

Diagnostics

  • E0802: the region is not a face.
  • E0800: the surface number is not defined.
  • E0102: a reduced index lies outside the part.
  • E0106: a range of the region is written high to low.

Example

The script tests/corpus/068-patch-not-face-rejected/input.tg, which make test runs:

sd 1 plan 0 0 0 0 0 1
block 1 2 3;1 2 3;1 2 3; 0 1 2; 0 1 2; 0 1 2;
patch 1 1 1 3 3 3 1
endpart

The region 1 1 1 3 3 3 spans every index, so it is a block. James prints this and exits with 1, as tests/corpus/068-patch-not-face-rejected/expected.diag.txt holds:

input.tg:3:7: error [E0802]: patch region must be a face, got block
james: 1 error, 0 warnings

See also

  • edge: the companion command for a surface’s boundary edges, refused for the same reason.
  • sf: projects a face onto a surface that James does have.
  • Compatibility: the commands James refuses.

James 0.3.1.

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