sketch code to 3d scene initial connection working

This commit is contained in:
Kurt Hutten IrevDev
2022-11-23 21:28:38 +11:00
parent 266edb578a
commit 5ce89d83fc
7 changed files with 204 additions and 71 deletions

View File

@ -62,15 +62,19 @@ log(5, myVar)`;
show(mySketch)
`;
const { root, return: _return } = exe(code);
expect(root.mySketch.map(({ previousPath, ...rest }: any) => rest)).toEqual(
[
{ type: "base", from: [0, 0] },
{ type: "toPoint", to: [0, 1], name: "myPath" },
{ type: "toPoint", to: [1, 1] },
{ type: "toPoint", to: [1, 0], name: "rightPath" },
{ type: "close", firstPath: { type: "base", from: [0, 0] } },
]
);
expect(
root.mySketch.map(({ previousPath, geo, ...rest }: any) => rest)
).toEqual([
{ type: "base", from: [0, 0] },
{ type: "toPoint", to: [0, 1], sourceRange: [25, 45], name: "myPath" },
{ type: "toPoint", to: [1, 1], sourceRange: [48, 59] },
{ type: "toPoint", to: [1, 0], sourceRange: [67, 90], name: "rightPath" },
{
type: "close",
firstPath: { type: "base", from: [0, 0] },
sourceRange: [93, 100],
},
]);
expect(root.mySketch[0]).toEqual(root.mySketch[4].firstPath);
// hmm not sure what handle the "show" function
expect(_return).toEqual([