mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 16:33:15 +01:00
Made fillet and Champher work for all edges of a selected face.
This commit is contained in:
parent
6c89bec12d
commit
8553ac15ef
1 changed files with 16 additions and 5 deletions
|
|
@ -7,9 +7,10 @@ import {FromMObjectProductionAnalyzer} from "cad/craft/production/productionAnal
|
|||
import {MEdge} from "cad/model/medge";
|
||||
import {MObject} from "cad/model/mobject";
|
||||
import {MShell} from "cad/model/mshell";
|
||||
import { MBrepFace } from 'cad/model/mface';
|
||||
|
||||
interface FilletParams {
|
||||
edges: MEdge[],
|
||||
edges: MEdge[] | MBrepFace[],
|
||||
size: number
|
||||
opperationType: 'Champher'|'Fillet'
|
||||
}
|
||||
|
|
@ -25,13 +26,23 @@ export const FilletOperation: OperationDescriptor<any> = {
|
|||
|
||||
const occ = ctx.occService;
|
||||
const oci = occ.commandInterface;
|
||||
let edgeList = [];
|
||||
|
||||
//check if input contains faces and if a face is an input add all adjacent edges to list for processing.
|
||||
params.edges.forEach((edge) => {
|
||||
if(edge.TYPE === EntityKind.FACE){
|
||||
edgeList = edgeList.concat(edge.edges);
|
||||
}
|
||||
if(edge.TYPE === EntityKind.EDGE){
|
||||
edgeList.push(edge);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//add all the edges and size to seperate arrays for each shell that edges are selected from
|
||||
|
||||
const groups = new Map<MShell, any[]>()
|
||||
|
||||
params.edges.forEach((edge) => {
|
||||
|
||||
edgeList.forEach((edge) => {
|
||||
let shellArgs = groups.get(edge.shell);
|
||||
if (!shellArgs) {
|
||||
shellArgs = [];
|
||||
|
|
@ -74,7 +85,7 @@ export const FilletOperation: OperationDescriptor<any> = {
|
|||
{
|
||||
type: 'selection',
|
||||
name: 'edges',
|
||||
capture: [EntityKind.EDGE],
|
||||
capture: [EntityKind.EDGE,EntityKind.FACE],
|
||||
label: 'edges',
|
||||
multi: true,
|
||||
defaultValue: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue