mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-07 08:53:25 +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 {UnitVector} from "math/vector";
|
||||
import {OperationDescriptor} from "cad/craft/operationPlugin";
|
||||
import {MLoop} from "cad/model/mloop";
|
||||
import {MObject} from "cad/model/mobject";
|
||||
|
||||
|
||||
interface ExtrudeParams {
|
||||
length: number;
|
||||
doubleSided:boolean,
|
||||
face: MFace;
|
||||
loops: MLoop[];
|
||||
profiles: MObject[];
|
||||
direction?: UnitVector,
|
||||
boolean: BooleanDefinition
|
||||
}
|
||||
|
|
@ -33,9 +33,9 @@ export const ExtrudeOperation: OperationDescriptor<ExtrudeParams> = {
|
|||
|
||||
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',
|
||||
name: 'loops',
|
||||
capture: [EntityKind.LOOP],
|
||||
label: 'loops',
|
||||
name: 'profiles',
|
||||
capture: [EntityKind.FACE, EntityKind.LOOP],
|
||||
label: 'profiles',
|
||||
optional: true,
|
||||
multi: true
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ export default {
|
|||
},
|
||||
rotations: {
|
||||
type: 'array',
|
||||
optional: true,
|
||||
defaultValue: [],
|
||||
items: {
|
||||
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()];
|
||||
applyRotation(csys, csys, r.angle, axis);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ export function SubForm(props: {name: ParamsPathSegment, children: any}) {
|
|||
const formParams = useContext(FormParamsContext);
|
||||
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]}>
|
||||
{props.children}
|
||||
</FormPathContext.Provider>
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ export function activate(context) {
|
|||
domElement.addEventListener('mousedown', mousedown, false);
|
||||
domElement.addEventListener('mouseup', mouseup, false);
|
||||
domElement.addEventListener('dblclick', mousedblclick, false);
|
||||
domElement.addEventListener('mousemove', mousemove, false);
|
||||
document.addEventListener('mousemove', mousemove, false);
|
||||
|
||||
let mouseState = {
|
||||
startX: 0,
|
||||
|
|
|
|||
Loading…
Reference in a new issue