Quiddity.Face (ExQuiddity v0.1.2)

Copy Markdown View Source

One face of a part: what kind of surface it is, how big it is, which way it faces, and what it touches.

"Face" here is the B-rep face — one trimmed piece of one surface — which is the unit quiddity's records are made of. A feature is a set of them (Quiddity.Recognition.owner/2 goes the other way), so a caller reading a face's surface is reading what it is made of, not what it is for.

Summary

Functions

One line about the face, in the words a person would use.

The diameter of a round face, in millimetres, or nil.

What kind of surface the face is: "plane", "cylinder", …

A face, as the engine answered it.

The radius of a cylindrical or spherical face, in millimetres, or nil.

Types

t()

@type t() :: %Quiddity.Face{
  area: float() | nil,
  bounds: map(),
  centroid: [float()] | nil,
  edges: [non_neg_integer()],
  index: non_neg_integer(),
  neighbours: [non_neg_integer()],
  normal: [float()] | nil,
  reversed: boolean(),
  surface: map()
}

Functions

describe(face)

@spec describe(t()) :: String.t()

One line about the face, in the words a person would use.

A .step file is a list of surface entities; a reader wants "cylindrical wall, 4 mm radius, 125.7 mm², facing +x". This is that sentence, and it is what the MCP tools print, so a model reads the same words a person would.

diameter(face)

@spec diameter(t()) :: float() | nil

The diameter of a round face, in millimetres, or nil.

kind(face)

@spec kind(t()) :: String.t()

What kind of surface the face is: "plane", "cylinder", …

parse(face)

@spec parse(map()) :: t()

A face, as the engine answered it.

radius(face)

@spec radius(t()) :: float() | nil

The radius of a cylindrical or spherical face, in millimetres, or nil.

A hole's wall is a cylinder, so this is the hole's radius — but a cylinder can also be a boss or a pin, which is why the family comes from the recognition and not from here.