mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 16:33:15 +01:00
added inteligent IDs to loft opperation
This commit is contained in:
parent
c577ca480d
commit
023abf177a
1 changed files with 20 additions and 17 deletions
|
|
@ -24,12 +24,28 @@ export const LoftOperation: OperationDescriptor<LoftParams> = {
|
||||||
let occ = ctx.occService;
|
let occ = ctx.occService;
|
||||||
const oci = occ.commandInterface;
|
const oci = occ.commandInterface;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
console.log(params.loops);
|
||||||
|
|
||||||
|
let sketches = [];
|
||||||
|
|
||||||
|
const wires = params.loops.map((loop, i) => {
|
||||||
|
const shapeName = "loop/" + i;
|
||||||
|
sketches.push(loop.parent);
|
||||||
|
|
||||||
|
return occ.io.sketchLoader.pushContourAsWire(loop.contour, shapeName, loop.face.csys).wire
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("This is the info you are looking for", sketches);
|
||||||
|
|
||||||
let loftType = 0;
|
let loftType = 0;
|
||||||
if (params.loftType == "smooth") loftType = 0;
|
if (params.loftType == "smooth") loftType = 0;
|
||||||
if (params.loftType == "sharp") loftType = 1;
|
if (params.loftType == "sharp") loftType = 1;
|
||||||
|
|
||||||
console.log(params.loops);
|
console.log(params.loops);
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
let sketches = [];
|
let sketches = [];
|
||||||
|
|
||||||
const wires = params.loops.map((loop, i) => {
|
const wires = params.loops.map((loop, i) => {
|
||||||
|
|
@ -47,24 +63,11 @@ export const LoftOperation: OperationDescriptor<LoftParams> = {
|
||||||
|
|
||||||
let sweepSources = [];
|
let sweepSources = [];
|
||||||
|
|
||||||
let indexOfMostSegments = 0;
|
sketches.forEach(await async function (item, index) {
|
||||||
let longestPath = 0;
|
|
||||||
let primarySketch = {};
|
|
||||||
|
|
||||||
sketches.forEach(function (item, index) {
|
|
||||||
console.log(item, index);
|
console.log(item, index);
|
||||||
if(params.loops[index].contour.segments.length > longestPath){
|
await sweepSources.concat(await occ.utils.sketchToFaces(ctx.sketchStorageService.readSketch(item.id), item.csys))
|
||||||
longestPath = params.loops[index].contour.segments.length;
|
|
||||||
|
|
||||||
primarySketch = params.loops[index].parent;
|
|
||||||
}
|
|
||||||
const face = occ.utils.sketchToFaces(ctx.sketchStorageService.readSketch(item.id), item.csys);
|
|
||||||
sweepSources = face;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const productionAnalyzer = new FromSketchProductionAnalyzer(sweepSources);
|
const productionAnalyzer = new FromSketchProductionAnalyzer(sweepSources);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -74,7 +77,7 @@ export const LoftOperation: OperationDescriptor<LoftParams> = {
|
||||||
let tools = [];
|
let tools = [];
|
||||||
tools.push(occ.io.getShell("th", productionAnalyzer));
|
tools.push(occ.io.getShell("th", productionAnalyzer));
|
||||||
|
|
||||||
return occ.utils.applyBooleanModifier(tools, params.boolean, [], [],)
|
return occ.utils.applyBooleanModifier(tools, params.boolean, sketches, [],)
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue