Scriptproblem with BReps and getNackedEdges

Next
 From:  Karsten (KMRQUS)
7819.1 
Hello,

I try to join some adjacent faces and get the boundary edges/loop from the result. Unfortunately I can't find a solution to get the edges. Here is what I try to do:

function getloops()
{
var inputobjects = moi.geometryDatabase.createObjectList();
inputobjects = moi.geometryDatabase.getSelectedObjects();
var loops = moi.geometryDatabase.createObjectList();
var output = moi.geometryDatabase.createObjectList();
var joinedInput = moi.geometryDatabase.createObjectList();
var joinedFacesEdges = moi.geometryDatabase.createObjectList();
var joinedFacesLoops = moi.geometryDatabase.createObjectList();
var joinedBRep = moi.geometryDatabase.createObjectList();
// this.inputobjects = selectBylist(this.properties.selObjects);
// loops = this.inputobjects.getCurves();
// var facebundles = this.inputobjects.getFaces();
var facebundles = inputobjects.getSingleFaceBReps();

if (loops.length < 2)
{
var joinFac = moi.command.createFactory('join');
joinFac.setInput(0, facebundles);
joinedInput = joinFac.calculate();
joinFac.commit();
// joinFac.cancel();

joinedBRep = joinedInput.getOpenBReps();
// joinedBRep = joinedInput.getTopLevelObjects();

// this.outputs[0].label = this.inputobjects.item(0).GeomObjectEnum;
for (var i = 0; i < joinedInput.length; i++)
{
joinedFacesEdges = joinedBRep.item(i).getNackedEdges(); // getOpenBReps getSubObjects().getBReps()..getNackedEdges()
// joinedFacesEdges = joinedInput.getTopLevelObjects().getNackedEdges(); // getOpenBReps getSubObjects().getBReps()..getNackedEdges()
// this.outputs[0].label = this.inputobjects.item(i).GeomObjectEnum;
}
var joinFac = moi.command.createFactory('join');
joinFac.setInput(0, joinedFacesEdges);
joinedFacesLoops = joinFac.calculate();
joinFac.commit();
for (var i = 0; i < joinedInput.length; i++)
{
loops.addObject(joinedFacesLoops.item(i));
}
}
//////////////////////testloft
var truncatedFac = moi.command.createFactory('loft');
truncatedFac.setInput(0, loops);
truncatedFac.setInput(2, 'Straight');
truncatedFac.setInput(3, false);
truncatedFac.setInput(4, false);
output = truncatedFac.calculate();
truncatedFac.commit();
// this.setOutputData(0, joinedFacesEdges);
//////////////////// end testloft
}
getloops();

Thanks in advance!

Have a nice day
Karsten
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7819.2 In reply to 7819.1 
Hi Karsten - it's a spelling problem there, (or more likely an unintended translation?) the name of that method is .getNakedEdges() - you've got an extra c in the middle there that needs to be removed.

That method will get edges that belong to only one face and are not joined between 2 faces.

The other edge getting methods you can call on a brep or face are:

getEdges() // Gets all edges

getJoinedEdges() // Gets edges that are joined between 2 faces (or seams too I think), leaving out naked edges

getNakedEdges() // The one you're trying to use

getSeamEdges() // Gets the seam edges of a closed surface.



Also another way to go through edges is to do it by the trim boundaries on a face by calling face.getLoops() - that returns a set of boundaries with the first boundary being the outer boundary of the face and any next ones being holes. Each boundary is itself a list of edges that make up the boundary.

Hope this helps!

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Karsten (KMRQUS)
7819.3 In reply to 7819.2 
Hello Michael,

thank You very much! I will test it:-)

Have a nice day
Karsten
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Karsten (KMRQUS)
7819.4 In reply to 7819.3 
Thanks again, Michael,

now everything works fine:-)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All