mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-08 01:13:27 +01:00
fix datum
This commit is contained in:
parent
e44d39547b
commit
3ff59aafbf
5 changed files with 12 additions and 10 deletions
|
|
@ -5,14 +5,14 @@ import {EntityKind} from "cad/model/entities";
|
||||||
import {BooleanDefinition} from "cad/craft/schema/common/BooleanDefinition";
|
import {BooleanDefinition} from "cad/craft/schema/common/BooleanDefinition";
|
||||||
import {UnitVector} from "math/vector";
|
import {UnitVector} from "math/vector";
|
||||||
import {OperationDescriptor} from "cad/craft/operationPlugin";
|
import {OperationDescriptor} from "cad/craft/operationPlugin";
|
||||||
import {MLoop} from "cad/model/mloop";
|
import {MObject} from "cad/model/mobject";
|
||||||
|
|
||||||
|
|
||||||
interface ExtrudeParams {
|
interface ExtrudeParams {
|
||||||
length: number;
|
length: number;
|
||||||
doubleSided:boolean,
|
doubleSided:boolean,
|
||||||
face: MFace;
|
face: MFace;
|
||||||
loops: MLoop[];
|
profiles: MObject[];
|
||||||
direction?: UnitVector,
|
direction?: UnitVector,
|
||||||
boolean: BooleanDefinition
|
boolean: BooleanDefinition
|
||||||
}
|
}
|
||||||
|
|
@ -33,9 +33,9 @@ export const ExtrudeOperation: OperationDescriptor<ExtrudeParams> = {
|
||||||
|
|
||||||
let occFaces = [];
|
let occFaces = [];
|
||||||
|
|
||||||
if (params.loops?.length > 0) {
|
if (params.profiles?.length > 0) {
|
||||||
|
|
||||||
params.loops
|
params.profiles
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -124,9 +124,10 @@ export const ExtrudeOperation: OperationDescriptor<ExtrudeParams> = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'selection',
|
type: 'selection',
|
||||||
name: 'loops',
|
name: 'profiles',
|
||||||
capture: [EntityKind.LOOP],
|
capture: [EntityKind.FACE, EntityKind.LOOP],
|
||||||
label: 'loops',
|
label: 'profiles',
|
||||||
|
optional: true,
|
||||||
multi: true
|
multi: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ export default {
|
||||||
},
|
},
|
||||||
rotations: {
|
rotations: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
|
optional: true,
|
||||||
defaultValue: [],
|
defaultValue: [],
|
||||||
items: {
|
items: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ function updateCSys(csys, params, findFace) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
params.rotations.forEach(r => {
|
(params.rotations||[]).forEach(r => {
|
||||||
let axis = csys[r.axis.toLowerCase()];
|
let axis = csys[r.axis.toLowerCase()];
|
||||||
applyRotation(csys, csys, r.angle, axis);
|
applyRotation(csys, csys, r.angle, axis);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ export function SubForm(props: {name: ParamsPathSegment, children: any}) {
|
||||||
const formParams = useContext(FormParamsContext);
|
const formParams = useContext(FormParamsContext);
|
||||||
const formPath = useContext(FormPathContext);
|
const formPath = useContext(FormPathContext);
|
||||||
|
|
||||||
return <FormParamsContext.Provider value={formParams[props.name] as any}>
|
return <FormParamsContext.Provider value={formParams[props.name]||{} as any}>
|
||||||
<FormPathContext.Provider value={[...formPath, props.name]}>
|
<FormPathContext.Provider value={[...formPath, props.name]}>
|
||||||
{props.children}
|
{props.children}
|
||||||
</FormPathContext.Provider>
|
</FormPathContext.Provider>
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ export function activate(context) {
|
||||||
domElement.addEventListener('mousedown', mousedown, false);
|
domElement.addEventListener('mousedown', mousedown, false);
|
||||||
domElement.addEventListener('mouseup', mouseup, false);
|
domElement.addEventListener('mouseup', mouseup, false);
|
||||||
domElement.addEventListener('dblclick', mousedblclick, false);
|
domElement.addEventListener('dblclick', mousedblclick, false);
|
||||||
domElement.addEventListener('mousemove', mousemove, false);
|
document.addEventListener('mousemove', mousemove, false);
|
||||||
|
|
||||||
let mouseState = {
|
let mouseState = {
|
||||||
startX: 0,
|
startX: 0,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue