add client lib @kittycad/lib (#214)

* add client lib

* tsc after build

* update after spec update

* remove uneeded check

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix camera drag

* fix throttle typing

* comment with link to issue

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Kurt Hutten
2023-08-02 15:41:59 +10:00
committed by GitHub
parent aabb88ee45
commit 5419039fae
12 changed files with 140 additions and 126 deletions

View File

@ -268,18 +268,16 @@ export const line: SketchLineHelper = {
params: [lineData, previousSketch],
range: sourceRange,
command: {
type: 'ModelingCmdReq',
type: 'modeling_cmd_req',
cmd: {
ExtendPath: {
path: sketchGroup.id,
segment: {
Line: {
end: {
x: lineData.to[0],
y: lineData.to[1],
z: 0,
},
},
type: 'extend_path',
path: sketchGroup.id,
segment: {
type: 'line',
end: {
x: lineData.to[0],
y: lineData.to[1],
z: 0,
},
},
},
@ -1571,11 +1569,10 @@ export const close: InternalFn = (
params: [lineData],
range: sourceRange,
command: {
type: 'ModelingCmdReq',
type: 'modeling_cmd_req',
cmd: {
ClosePath: {
path_id: sketchGroup.id,
},
type: 'close_path',
path_id: sketchGroup.id,
},
cmd_id: id,
file_id: uuidv4(),
@ -1637,24 +1634,23 @@ export const startSketchAt: InternalFn = (
params: [lineData],
range: sourceRange,
command: {
type: 'ModelingCmdReq',
type: 'modeling_cmd_req',
cmd: {
StartPath: {},
type: 'start_path',
},
cmd_id: pathId,
file_id: uuidv4(),
},
})
engineCommandManager.sendSceneCommand({
type: 'ModelingCmdReq',
type: 'modeling_cmd_req',
cmd: {
MovePathPen: {
path: pathId,
to: {
x: lineData.to[0],
y: lineData.to[1],
z: 0,
},
type: 'move_path_pen',
path: pathId,
to: {
x: lineData.to[0],
y: lineData.to[1],
z: 0,
},
},
cmd_id: id,