Quick Start Tutorial
This tutorial assumes you already have a basic understanding of gemstone faceting. Hackagem uses JavaScript to run the code and create the faceting designs. This might sound intimidating for non-programmers and even for programmers đ, but in practice, it functions here more like a specification language than a traditional programming language. Initially, we experimented with developing a new specification language specifically for faceting designs, but we realized it wasnât a good idea. ...
Manual
Hackagem is a tool to design faceted gemstones. Other such tools exist, but the main difference between this tool and others is that Hackagem uses a language to specify designs. The language is JavaScript. While JavaScript is a full-fledged programming language, we primarily use it as a specification language in this context. Therefore, weâll be working with a limited subset of JavaScript. However, if youâre new to it, checking out a basic guide to JavaScript, like this one, would be helpful. That said, thereâs nothing stopping you from utilizing the full range of JavaScriptâs features. ...
Release Notes
2024-11-30 New preform outlines For instance there is the Double-truncated Rectangle to get smooth corners. A double-truncated rectangle starts as a rectangle with all four corners truncated, forming an octagon. This octagon is then truncated again at its corners, resulting in a 16-sided polygon with smoothed edges, featuring four original sides shortened by truncations and 12 additional edges created through the two stages of corner cuts All outlines. 2024-10-31 Bug fixes Fixed a number of bugs ...
Reference
Cutting cut() test() crown() pavilion() Indices index() range() list() table() setIndexGear() getIndexGear() setSym() Meetpoints and Edges meet() between() findEdge() onEdge() level() meetGirdle() centerPoint() show() matchX() matchZ() point() setSize() Design Info setName() setDesigner() setShape() setInfo() setRI() setAbsorption() setColor() CAM createRectangle() createTruncatedRectangle() createTruncatedSquare() createCushionedTruncatedSquare() createEllipse() createTruncatedTriangle() Algorithmic Design generateSignCombinations() generateEvenSignCombinations() generateEvenPermutationsForArrayOfPoints() cutMagic() Miscellaneous deg2rad() rad2deg() GemCadImport() indexFrac() Documentation ⢠Docs Documentation Classes Color Constructors new Color() new Color(): Color Returns Color Properties Aqua static Aqua: string = "#00FFFF" ...
Best Design Style Practices
This post focuses on the preferred design style for new designs. It wonât cover brilliance, scintillation, light return or anything like that, but will instead focus on structuring the cutting steps to achieve the desired outcome. The main idea is that all steps should be connected in a way that allows changes to be made while keeping the overall design idea intact. While this approach may seem cumbersome at first, it can save you significant time and headaches later. It not only gives the designer greater flexibility in fine-tuning the design, but also benefits the automated optimizer (once it becomes available). ...
Debugging
When a cut doesnât perform as expected or throws error messages, it can be tricky to identify the issue. Here are some tips and tools you can use to debug your code. Isolate the Problem Sometimes, itâs helpful to âcomment outâ portions of code that arenât essential to locate the issue. The return statement can also be useful, as it immediately stops program execution at that location â provided itâs not within a function. ...
Algorithmic Design
This is a preview. The example is functional, but the documentation for the functions used (and others) is not yet available. Additional types of algorithmic designs will be added at some point. Convex polyhedra There are many beautiful regular polyhedra that can be cut. Their appeal does not stem from how they interact with light, but more in the elegance of their symmetrical forms. However, obtaining precise cutting instructions for these polyhedra can be quite challenging. Thatâs where Hackagen comes in. The concept is simple: you provide a list of 3D points, and Hackagen determines the facets and generates a detailed cutting diagram. ...
Advanced Meetpoints
This post is still Work in Progress. Using a non-baseIndex for meetpoint selection Look at tier 9 in the following designby Fred W. Van Sant, Star Cuts III (1989). As you can see the cut meets the girdle, but only at the corners of the stone. The indices for tier 9 are: 00-04-08-12-16-20-24-28-32-36-40-44-48-52-56-60. However, the 00 index is not in the corner so we canât use: cut("9", range(0, 4), 41, meet("3,8")) because meet() by default uses the baseIndex when looking for meeting points. The solution is to use a second parameter in our meet() function that overrides the baseIndex. We know that the corner is at index 8, so we can use: cut("9", range(0, 4), 41, meet("3,8", 8)). ...
GemCad Import
Hackagem can import GemCad .asc files using the GemCadImport function, which takes a single string argument. Since these files contain multiple lines, the most convenient way to pass the string is by enclosing it with backtick (`) characters instead of double or single quotes, like so: GemCadImport(` GemCad 5.0 g 96 0.0 y 4 y I 1.54 H PC 11.134 SMALLEST SQUARE H Robert H. Long, 7/27/17 H Assigned to the Public Domain a 90.000000 1.09380454 96 24 48 72 n g1 a -38.000000 0.87556750 96 72 48 24 n 1 a 20.000000 0.23666377 96 24 48 72 n a a 10.000000 0.12457376 12 36 60 84 n b F For Low RI Material `) After executing this youâll get the complete faceting diagram. Hackagem has a hidden feature to translate the GemCad file into a hackagen program. To see this youâll have to go to the âDeveloper toolsâ and look in the console for the program. ...
Establishing the Gem Outline using CAM
The Centerpoint-Angle Method (CAM) is a gem-cutting technique used to create precise girdle outlines, especially for complex or asymmetrical shapes. CAM preform involves cutting initial shallow pavilion facets to a culet point, which then allows for a level girdle cut, defining the stoneâs outline. Some designs retain the CAM culet, while others cut it away. Hackagem can create all the steps for a variety of outlines, from rectangles to ovals. ...