Comment by DannyBee
You could port it, but i don't think the geometry kernel is the hard part.
The code for the standard library is here: https://cad.onshape.com/documents/12312312345abcabcabcdeff/w...
(Click tab manager in the bottom left and you'll get a nicer list of the files involved)
The actual representation is essentially dictionaries. IE transform is a functon that looks like this:
/**
* Construct a [Transform] using the matrix argument for rotation
* and scaling and the vector argument for translation.
*/
export function transform(linear is Matrix, translation is Vector) returns Transform
precondition
{
matrixSize(linear) == [3, 3];
is3dLengthVector(translation);
}
{
return { "linear" : linear, "translation" : translation } as Transform;
}
Fillets, for example, are a whole bunch of featurescript UI around fillet operations:https://cad.onshape.com/documents/12312312345abcabcabcdeff/w...
(The underlying fillet ops are opFullRoundFillet, etc. All of this is UI to generate the parameters and highlight the results and such)
The actual geometry ops are in geomOperations. Those are the geometry primitives you'd have to duplicate, and they are fairly standard. Fillets, holes, CSG, etc.
It would not be a ton of work (IMHO) to have a geometry kernel that supports what they support.
The UI related primitives, the query engine, etc, those are i think where you'd have real work to do.