Skip to content

Profile Generator ​

Overview ​

A ring profile is the cross section of the band: the shape you see when you cut the ring across. The Wedding Band Builder supports two kinds of profiles:

KindSourceHow the size changes
Curve profileA closed curve in a .3dm fileThe curve is stretched to the chosen width and thickness
Generated profileA row of a profile catalogueThe section is built again for the exact width and thickness

A stretched curve keeps its proportions. Its corner radii and arcs grow and shrink with the band. A manufacturer does not make bands that way. A 3 mm band and an 8 mm band of the same profile have different arcs and corners, and the manufacturer lists them in a size table.

The profile generator uses that size table. It builds the section from the values of the row for the chosen size, so the band on screen has the same shape as the band that the workshop makes.

Use generated profiles when:

  • The manufacturer makes each profile only in a fixed set of sizes.
  • The arcs and corners change from size to size.
  • The production files must name the manufacturer's own profile codes.

Curve profiles continue to work as before. One project can mix both kinds.

Editor UI

Today you add a catalogue to a project as a JSON file. An editor UI to create and edit catalogues is planned.


The Profile Catalogue ​

A profile catalogue is a JSON file with one entry per profile. Each profile has one row per manufacturable width and thickness.

json
{
  "version": 1,
  "client": "acme",
  "profiles": [
    {
      "id": "P1",
      "name": "Dome",
      "source": "table",
      "columns": ["w", "h", "RA", "RI", "ERA", "ERI"],
      "rows": [
        [4, 1.5, 6, 8, 0.3, 0.3],
        [4, 1.7, 6, 8, 0.3, 0.3],
        [5, 1.6, 7, 9, 0.3, 0.3]
      ],
      "optimal": [[4, 1.5], [5, 1.6]]
    }
  ]
}

Catalogue fields ​

FieldRequiredDescription
versionYesAlways 1
clientNoA label for the owner of the catalogue. It is never parsed.
sourceNoWhere the data came from: { file?, date?, note? }
profilesYesThe profiles

Profile fields ​

FieldRequiredDescription
idYesThe manufacturer's own profile code, for example P1 or R110. The builder shows and exports it as it is, and never parses it.
nameYesThe display name
titleNoA longer description
versionNoA number for your own records. Increase it when the rows change.
sourceYesAlways "table"
concaveNotrue when the outer arc dips inward (a hollow profile)
columnsYesThe names of the values in each row, in order. w and h are required.
rowsYesOne row for each size that the manufacturer makes, with the values in columns order
optimalNoThe recommended thickness for each width, as [widthMm, thicknessMm] pairs. Without it, the builder uses the middle allowed thickness at that width.

Row values ​

All values are in millimetres, except angle. A column that is not in columns reads as 0.

ColumnMeaning0 means
wBand width(required)
hBand thickness, from the inner surface to the top of the outer surface(required)
RARadius of the outer arcA flat outer surface
RIRadius of the inner arcA flat inner surface (bore)
ERARadius of the outer corner roundNo round
ERIRadius of the inner corner roundNo round
FALeg length of a 45° chamfer at the outer cornerNo chamfer
FILeg length of a 45° chamfer at the inner cornerNo chamfer
angleAngle of the side from vertical, in degrees. The bore side is narrower.Vertical sides

Use a round (ERA, ERI) or a chamfer (FA, FI) at a corner, not both. When a row has both, the generator uses the round.

Validation ​

The builder checks the catalogue when the project loads. A catalogue is rejected when:

  • It does not match the format above.
  • A row does not have one value for each column.
  • A width or thickness is zero or negative.
  • The same width and thickness is listed twice in one profile.

A wrong catalogue key or profile id in the project also stops the load, with a message that names the profile. The error shows when the project opens, not when a shopper first selects the profile.


How a Row Becomes a Section ​

The generator builds a closed, symmetric section from one row. It builds the right half and mirrors it.

  1. Outer part. The outer arc (RA) has its top at the full thickness. The outer corner (ERA or FA) touches the band width. The side runs down from the corner, vertical or at angle.
  2. Inner part. The inner arc (RI) has its lowest point on the bore. The inner corner (ERI or FI) joins the side and the inner arc.

Some combinations of values do not fit. The generator then follows fixed rules instead of failing:

  • An arc radius smaller than half the width becomes a semicircle.
  • A corner radius larger than half the width is reduced to half the width.
  • When the outer and inner corners do not both fit on the side, the inner corner is reduced until they meet.
  • When the inner arc does not fit under the outer corner at all, the inner corner is dropped and the inner arc radius is increased.

A row that still gives an impossible shape (the outline leaves its width and thickness box or crosses itself) is marked invalid. Check each catalogue before you use it in a live project.


Add a Catalogue to a Project ​

The project manifest names its catalogues in profileCatalogs and points profiles at them with source.

json
{
  "profileCatalogs": {
    "acme": "catalogs/acme.json"
  },
  "profiles": [
    { "id": "d-shape", "name": "D-Shape", "file": "profiles/d-shape.3dm" },
    { "id": "P1", "name": "Dome", "source": { "type": "table", "catalog": "acme" } },
    { "id": "P2", "name": "Flat", "source": { "type": "table", "catalog": "acme", "profile": "F-02" } }
  ]
}
  • profileCatalogs: a map from a key to a catalogue. The value is the URL of the catalogue JSON, which resolves like every other asset path, or the catalogue object itself.
  • source.type: always "table".
  • source.catalog: the key in profileCatalogs. You can omit it when the project has only one catalogue.
  • source.profile: the profile id in the catalogue. The default is the entry's own id.

A profile with a source needs no .3dm file. When it has no iconUrl, the profile picker shows a drawing of the generated section.

Catalogues are your data

A catalogue holds a manufacturer's size table. The viewer loads it by URL, so anyone who can open the viewer can read the file. Do not put prices or other private data in it.


Sizes and Snapping ​

A generated profile exists only in the sizes of its rows. The builder keeps the band on those sizes:

  • Width snaps to the nearest width in the table.
  • Thickness snaps to the nearest thickness that the table lists at that width.
  • Optimal thickness comes from optimal for that width. When optimal has no entry, it is the middle allowed thickness.
  • Thickness range (getThicknessRangeMm()) is the smallest and largest thickness that the table lists at the current width.

The snap happens on every change: a width or thickness change, a profile change, a batch update, and a saved or shared design when it loads. A design that was saved before a table changed loads at the nearest size that still exists.

A curve profile has no table. Its width and thickness stay continuous within the product range, as described in Measurement System.


API ​

These controller methods and events report generated profiles. See the API Reference for the full controller.

getAvailableProfiles() ​

Each entry has a source field: 'table' for a generated profile and 'curve' for a .3dm profile.

javascript
api.getAvailableProfiles();
// [{ index: 0, id: 'd-shape', name: 'D-Shape', source: 'curve' },
//  { index: 1, id: 'P1', name: 'Dome', source: 'table', iconUrl: 'data:image/svg+xml,...' }]

getAllowedSizes(bandName?) ​

Returns every allowed width, and the allowed thicknesses at the current width, in millimetres. Returns null for a curve profile. Use it to build a size picker with only the sizes that the manufacturer makes.

javascript
const sizes = api.getAllowedSizes();
// { widths: [3, 3.5, 4, 4.5, 5, 6], heights: [1.5, 1.7, 1.9] }

Returns: { widths: number[]; heights: number[] } | null

getProfileSection(bandName?) ​

Returns the generated section at the band's current size: the profile code, the size of the row it snapped to, the outline in millimetres, and an SVG preview as a data: URL. Returns null for a curve profile.

javascript
const sec = api.getProfileSection();
img.src = sec.svg;
console.log(sec.profileId, sec.widthMm, sec.heightMm);

Returns: { profileId: string; widthMm: number; heightMm: number; points: { x: number; y: number }[]; svg: string } | null

profile:changed ​

The event carries profileId, the profile's id from the manifest. For a generated profile this is the manufacturer's code.

javascript
api.on('profile:changed', ({ bandName, profileIndex, profileName, profileId }) => {
  console.log(`${bandName}: ${profileName} (${profileId})`);
});

Prepare a Catalogue ​

Most manufacturers keep their size table as a spreadsheet. iJewel can convert it to a catalogue for you. The spreadsheet needs:

  • One sheet for each profile. The first word of the sheet name is the profile code.
  • A header row with the columns for width (Breite), thickness (Höhe), RA, RI, ERA, ERI, FA, FI, and the side angle.
  • One row for each size that the manufacturer makes.
  • Optionally, a second width and thickness pair to the right of the table, with the optimal thickness for each width.

The conversion checks every row, builds every section once, and reports the rows that needed one of the rules above. Review that report with the manufacturer before the catalogue goes live.

Contact contact@ijewel3d.com to have a size table converted.