stable face IDs for primitive opperations using featureId param.

This commit is contained in:
Mike Molinari 2022-12-07 00:35:23 +00:00
parent 22cdafd336
commit ee4a19e720
5 changed files with 26 additions and 24 deletions

View file

@ -14,9 +14,10 @@ interface PrimitiveBoxParams {
z: number, z: number,
locations: MDatum, locations: MDatum,
boolean: BooleanDefinition, boolean: BooleanDefinition,
featureId:string,
} }
export const PrimitiveBoxOperation: OperationDescriptor<PrimitiveBoxParams> = { export const PrimitiveBoxOperation: OperationDescriptor<any> = {
id: 'BOX', id: 'BOX',
label: 'Box', label: 'Box',
icon, icon,
@ -67,6 +68,7 @@ export const PrimitiveBoxOperation: OperationDescriptor<PrimitiveBoxParams> = {
run: (params: PrimitiveBoxParams, ctx: ApplicationContext) => { run: (params: PrimitiveBoxParams, ctx: ApplicationContext) => {
console.log(params , this);
const occ = ctx.occService; const occ = ctx.occService;
const oci = occ.commandInterface; const oci = occ.commandInterface;
@ -82,37 +84,37 @@ export const PrimitiveBoxOperation: OperationDescriptor<PrimitiveBoxParams> = {
const box = occ.io.getShell("box", new ExpectedOrderProductionAnalyzer( const box = occ.io.getShell("box", new ExpectedOrderProductionAnalyzer(
[ [
{ {
id: 'F:LEFT', id: params.featureId + 'F:LEFT',
productionInfo: { productionInfo: {
role: 'sweep' role: 'sweep'
} }
}, },
{ {
id: 'F:RIGHT', id: params.featureId + 'F:RIGHT',
productionInfo: { productionInfo: {
role: 'sweep' role: 'sweep'
} }
}, },
{ {
id: 'F:BASE', id: params.featureId + 'F:BASE',
productionInfo: { productionInfo: {
role: 'base' role: 'base'
} }
}, },
{ {
id: 'F:LID', id: params.featureId + 'F:LID',
productionInfo: { productionInfo: {
role: 'lid' role: 'lid'
} }
}, },
{ {
id: 'F:BACK', id: params.featureId + 'F:BACK',
productionInfo: { productionInfo: {
role: 'sweep' role: 'sweep'
} }
}, },
{ {
id: 'F:FRONT', id: params.featureId + 'F:FRONT',
productionInfo: { productionInfo: {
role: 'sweep' role: 'sweep'
} }

View file

@ -88,7 +88,7 @@ export const PrimitiveConeOperation: OperationDescriptor<PrimitiveConeParams> =
const newFacesIds = [ const newFacesIds = [
{ {
id: 'F:SIDE', id: params.featureId + 'F:SIDE',
productionInfo: { productionInfo: {
role: 'sweep' role: 'sweep'
} }
@ -97,7 +97,7 @@ export const PrimitiveConeOperation: OperationDescriptor<PrimitiveConeParams> =
if (params.diameterB > 0) { if (params.diameterB > 0) {
newFacesIds.push({ newFacesIds.push({
id: 'F:BASE', id: params.featureId + 'F:BASE',
productionInfo: { productionInfo: {
role: 'base' role: 'base'
} }
@ -106,7 +106,7 @@ export const PrimitiveConeOperation: OperationDescriptor<PrimitiveConeParams> =
if (params.diameterA > 0) { if (params.diameterA > 0) {
newFacesIds.push({ newFacesIds.push({
id: 'F:LID', id: params.featureId + 'F:LID',
productionInfo: { productionInfo: {
role: 'lid' role: 'lid'
} }

View file

@ -81,19 +81,19 @@ export const PrimitiveCylinderOperation: OperationDescriptor<PrimitiveCylinderPa
const cylinder = occ.io.getShell("cylinder", new ExpectedOrderProductionAnalyzer( const cylinder = occ.io.getShell("cylinder", new ExpectedOrderProductionAnalyzer(
[ [
{ {
id: 'F:SIDE', id: params.featureId + 'F:SIDE',
productionInfo: { productionInfo: {
role: 'sweep' role: 'sweep'
} }
}, },
{ {
id: 'F:BASE', id: params.featureId + 'F:BASE',
productionInfo: { productionInfo: {
role: 'base' role: 'base'
} }
}, },
{ {
id: 'F:LID', id: params.featureId + 'F:LID',
productionInfo: { productionInfo: {
role: 'lid' role: 'lid'
} }

View file

@ -75,7 +75,7 @@ export const PrimitiveSphereOperation: OperationDescriptor<PrimitiveSphereParams
const sphere = occ.io.getShell("sphere", new ExpectedOrderProductionAnalyzer( const sphere = occ.io.getShell("sphere", new ExpectedOrderProductionAnalyzer(
[ [
{ {
id: 'F:SPHERE', id: params.featureId + 'F:SPHERE',
productionInfo: { productionInfo: {
role: 'sweep' role: 'sweep'
} }

View file

@ -81,7 +81,7 @@ export const PrimitiveTorusOperation: OperationDescriptor<PrimitiveTorusParams>
const torus = occ.io.getShell("torus", new ExpectedOrderProductionAnalyzer( const torus = occ.io.getShell("torus", new ExpectedOrderProductionAnalyzer(
[ [
{ {
id: 'F:TORUS', id: params.featureId + 'F:TORUS',
productionInfo: { productionInfo: {
role: 'sweep' role: 'sweep'
} }