Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Advanced Optimization

This chapter describes advanced FSL properties designed for optimizing gemstone designs, particularly for ensuring geometric integrity and achieving specific proportions.

Note: Use these properties in combination with the assert statement to enforce specific geometric properties of the gemstone during the optimization process. Ensure that the geometry is valid before running the optimization process.

Geometric Properties

The stone() function returns an object with real-time properties of the gemstone. These allow you to assert specific geometric properties during the optimization process. They are particularly useful for:

  1. Preventing Girdle Corruption: Ensuring the girdle remains even and vertical.
  2. Shape Constraints: Enforcing specific ratios like table size or depth.

stone().isGirdleOK

Checks if the girdle is "even". An even girdle means:

  • All girdle facets (vertical facets) have the same height (within a small tolerance).
  • All girdle facets are centered at the same vertical position (Z).

Usage:

assert(stone().isGirdleOK, "Girdle issue!")

Use this assertion to reject any optimization steps that result in an uneven or twisted girdle.

stone().tablePercentage

Calculates the ratio of the table width to the stone's total width (diameter), expressed as a percentage.

  • Table Width: The width (along X-axis) of the largest facet with a normal pointing straight up (0, 0, 1).
  • Stone Width: The total width of the stone along the X-axis.

Usage:

// Ensure table is between 50% and 60%
assert(stone().tablePercentage >= 50, "Table too small!")
assert(stone().tablePercentage <= 60, "Table too big!")

stone().depthPercentage

Calculates the ratio of the stone's total depth (height) to its width, expressed as a percentage.

  • Total Depth: The vertical distance between the lowest and highest points of the stone.
  • Stone Width: The total width of the stone along the X-axis.

Usage:

// Target a specific depth percentage
assert(Math.abs(stone().depthPercentage - 60) < 1, "Depth too small!")

stone().crownHeight

Calculates the height of the crown as a percentage of the total stone height.

  • Crown Height: The vertical distance from the top of the girdle to the highest point of the stone (usually the table).
  • Total Height: The vertical distance between the lowest and highest points of the stone.

Usage:

// Ensure crown height is around 15% of total height
assert(Math.abs(stone().crownHeight - 15) < 2, "Crown height issue!")

stone().facetCount

Returns the total number of facets in the gemstone.

Usage:

// Ensure the design has exactly 57 facets
assert(stone().facetCount == 57, "Facet count issue!")

stone().pavilionDepth

Calculates the height of the pavilion as a percentage of the total stone height.

  • Pavilion Height: The vertical distance from the bottom of the girdle to the lowest point of the stone (culet).
  • Total Height: The vertical distance between the lowest and highest points of the stone.

Usage:

// Ensure pavilion depth is around 43%
assert(Math.abs(stone().pavilionDepth - 43) < 2, "Pavilion depth issue!")

stone().girdleThickness

Calculates the average girdle thickness as a percentage of the stone's width.

  • Girdle Thickness: Average vertical thickness of facets whose normals are vertical (girdle facets).
  • Stone Width: The total width of the stone along the X-axis.

Usage:

// Keep girdle between 3% and 5% of width
assert(stone().girdleThickness >= 3, "Girdle too thin!")
assert(stone().girdleThickness <= 5, "Girdle too thick!")

stone().lengthWidthRatio

Calculates the ratio of the stone's larger dimension to its smaller dimension (Length/Width or Width/Length).

  • Result: Always greater than or equal to 1.0.

Usage:

// Ensure the stone is perfectly square/round (ratio 1.0)
assert(Math.abs(stone().lengthWidthRatio - 1.0) < 0.01)