Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
548b45905e | |||
141fd2f3f1 | |||
604d931962 | |||
b1668410f8 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "untitled-app",
|
"name": "untitled-app",
|
||||||
"version": "0.11.2",
|
"version": "0.11.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/autocomplete": "^6.10.2",
|
"@codemirror/autocomplete": "^6.10.2",
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "kittycad-modeling",
|
"productName": "kittycad-modeling",
|
||||||
"version": "0.11.2"
|
"version": "0.11.3"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
|
@ -32,11 +32,10 @@ export function useEngineConnectionSubscriptions() {
|
|||||||
const unSubClick = engineCommandManager.subscribeTo({
|
const unSubClick = engineCommandManager.subscribeTo({
|
||||||
event: 'select_with_point',
|
event: 'select_with_point',
|
||||||
callback: async (engineEvent) => {
|
callback: async (engineEvent) => {
|
||||||
if (!context.sketchEnginePathId) return
|
|
||||||
const event = await getEventForSelectWithPoint(engineEvent, {
|
const event = await getEventForSelectWithPoint(engineEvent, {
|
||||||
sketchEnginePathId: context.sketchEnginePathId,
|
sketchEnginePathId: context.sketchEnginePathId,
|
||||||
})
|
})
|
||||||
send(event)
|
event && send(event)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
return () => {
|
return () => {
|
||||||
|
@ -238,10 +238,10 @@ class KclManager {
|
|||||||
defaultPlanes: this.defaultPlanes,
|
defaultPlanes: this.defaultPlanes,
|
||||||
})
|
})
|
||||||
this.isExecuting = false
|
this.isExecuting = false
|
||||||
this._logs = logs
|
this.logs = logs
|
||||||
this._kclErrors = errors
|
this.kclErrors = errors
|
||||||
this._programMemory = programMemory
|
this.programMemory = programMemory
|
||||||
this._ast = { ...ast }
|
this.ast = { ...ast }
|
||||||
if (updateCode) {
|
if (updateCode) {
|
||||||
this.code = recast(ast)
|
this.code = recast(ast)
|
||||||
}
|
}
|
||||||
|
@ -102,8 +102,8 @@ export async function getEventForSelectWithPoint(
|
|||||||
Models['OkModelingCmdResponse_type'],
|
Models['OkModelingCmdResponse_type'],
|
||||||
{ type: 'select_with_point' }
|
{ type: 'select_with_point' }
|
||||||
>,
|
>,
|
||||||
{ sketchEnginePathId }: { sketchEnginePathId: string }
|
{ sketchEnginePathId }: { sketchEnginePathId?: string }
|
||||||
): Promise<ModelingMachineEvent> {
|
): Promise<ModelingMachineEvent | null> {
|
||||||
if (!data?.entity_id) {
|
if (!data?.entity_id) {
|
||||||
return {
|
return {
|
||||||
type: 'Set selection',
|
type: 'Set selection',
|
||||||
@ -120,6 +120,7 @@ export async function getEventForSelectWithPoint(
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!sketchEnginePathId) return null
|
||||||
// selected a vertex
|
// selected a vertex
|
||||||
const res = await engineCommandManager.sendSceneCommand({
|
const res = await engineCommandManager.sendSceneCommand({
|
||||||
type: 'modeling_cmd_req',
|
type: 'modeling_cmd_req',
|
||||||
|
@ -31,7 +31,7 @@ pub struct StdLib {
|
|||||||
|
|
||||||
impl StdLib {
|
impl StdLib {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
let internal_fns: Vec<Box<(dyn crate::docs::StdLibFn)>> = vec![
|
let internal_fns: [Box<dyn crate::docs::StdLibFn>; 55] = [
|
||||||
Box::new(Show),
|
Box::new(Show),
|
||||||
Box::new(LegLen),
|
Box::new(LegLen),
|
||||||
Box::new(LegAngX),
|
Box::new(LegAngX),
|
||||||
@ -88,11 +88,10 @@ impl StdLib {
|
|||||||
Box::new(crate::std::math::Log10),
|
Box::new(crate::std::math::Log10),
|
||||||
Box::new(crate::std::math::Ln),
|
Box::new(crate::std::math::Ln),
|
||||||
];
|
];
|
||||||
|
let fns = internal_fns
|
||||||
let mut fns = HashMap::new();
|
.into_iter()
|
||||||
for internal_fn in &internal_fns {
|
.map(|internal_fn| (internal_fn.name(), internal_fn))
|
||||||
fns.insert(internal_fn.name().to_string(), internal_fn.clone());
|
.collect();
|
||||||
}
|
|
||||||
|
|
||||||
Self { fns }
|
Self { fns }
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user