mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 16:33:15 +01:00
Fix for loft opperation Production Analyzer
This commit is contained in:
parent
01d0eece16
commit
c577ca480d
1 changed files with 23 additions and 9 deletions
|
|
@ -24,7 +24,9 @@ export const LoftOperation: OperationDescriptor<LoftParams> = {
|
|||
let occ = ctx.occService;
|
||||
const oci = occ.commandInterface;
|
||||
|
||||
|
||||
let loftType = 0;
|
||||
if (params.loftType == "smooth") loftType = 0;
|
||||
if (params.loftType == "sharp") loftType = 1;
|
||||
|
||||
console.log(params.loops);
|
||||
|
||||
|
|
@ -32,25 +34,37 @@ export const LoftOperation: OperationDescriptor<LoftParams> = {
|
|||
|
||||
const wires = params.loops.map((loop, i) => {
|
||||
const shapeName = "loop/" + i;
|
||||
sketches.push(loop.parent);
|
||||
const sketch = loop.parent
|
||||
sketches.push(sketch);
|
||||
|
||||
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;
|
||||
if (params.loftType == "smooth") loftType = 0;
|
||||
if (params.loftType == "sharp") loftType = 1;
|
||||
|
||||
|
||||
|
||||
let sweepSources = [];
|
||||
|
||||
sketches.forEach(await async function (item, index) {
|
||||
let indexOfMostSegments = 0;
|
||||
let longestPath = 0;
|
||||
let primarySketch = {};
|
||||
|
||||
sketches.forEach(function (item, index) {
|
||||
console.log(item, index);
|
||||
await sweepSources.concat(await occ.utils.sketchToFaces(ctx.sketchStorageService.readSketch(item.id), item.csys))
|
||||
if(params.loops[index].contour.segments.length > longestPath){
|
||||
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);
|
||||
|
||||
|
||||
|
|
@ -60,7 +74,7 @@ export const LoftOperation: OperationDescriptor<LoftParams> = {
|
|||
let tools = [];
|
||||
tools.push(occ.io.getShell("th", productionAnalyzer));
|
||||
|
||||
return occ.utils.applyBooleanModifier(tools, params.boolean, sketches, [],)
|
||||
return occ.utils.applyBooleanModifier(tools, params.boolean, [], [],)
|
||||
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue