boundare edges scripts
 1-20  21-39

Next
 From:  Andrei Samardac
5922.1 
Hallo Michael, could you pleas make some scripts:
1. Select boundary edges on selected surface and if possible on selected joined surface
2. First script + delet selected edges.
  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
5922.2 In reply to 5922.1 
Hi mir4ea, there's a script here which will switch from a face selection to an edge selection, does it do what you are asking for with #1 or do you need something slightly different from that?

http://kyticka.webzdarma.cz/3d/moi/#SwitchSelectionFromFaceToEdges

- 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:  Michael Gibson
5922.3 In reply to 5922.1 
Or do you mean you want only "naked edges" to be selected, those are edges that only belong to one surface instead of being joined between 2 surfaces?

- 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:  Andrei Samardac
5922.4 In reply to 5922.3 
Yes may be "naked edges".
I'll better show you what I mean.



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:  Andrei Samardac
5922.5 In reply to 5922.4 
I just found script that selects nacked edges it's good, but it selects and edges around circles that is inside surfaces. I need script that is like this but without selecting edges inside surfaces. Is it possible?
  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
5922.6 In reply to 5922.4 
Hi mir4ea, yes it's possible to target selection on just the "outer loop" of a face, I've put a script below that will do that, to use it select the objects you want, and when you trigger the script the selected objects will have selection switch to naked edges on their outer boundaries like you show there.

But note that you can't delete an edge selection like the one on the right that you show there - in order to delete edges the entire boundary loop of edges on a single face needs to be selected and also none of them joined to other faces, so you would need to use Edit > Separate on a joined object like that before being able to remove the outer trimming boundaries. The removal works on a per-face level and will remove a face's trimming boundary.

Here's the selection script though, does this do the selection job that you are asking about? :

script: /* switch selection to naked edges of outer loops */ var gd = moi.geometryDatabase; var breps = gd.getSelectedObjects().getBReps(); gd.deselectAll(); for ( var i = 0; i < breps.length; ++i ) { var brep = breps.item(i); var faces = brep.getFaces(); for ( var j = 0; j < faces.length; ++j ) { var face = faces.item(j); var loops = face.getLoops(); var edges = loops.item(0); for ( var k = 0; k < edges.length; ++k ) { var edge = edges.item(k); if ( edge.getFacesOfEdge().length == 1 ) { edge.selected = true; } } } }

- 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:  Andrei Samardac
5922.7 In reply to 5922.6 
Yes I know about removing edges, Thanx a lot for the script, it's what I asked.
  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:  Andrei Samardac
5922.8 In reply to 5922.7 
Michael could you pleas make second version of this script, that will delete edges after selection.
  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
5922.9 In reply to 5922.8 
Hi mir4ea, because the delete involves modifying geometry and not just altering selection states, it needs to be run in a slightly different way - instead of an "inline script" it needs to be a command.

I've attached a command script that will do this function, to use it copy the attached file into the \commands sub-folder inside of MoI's main installation folder, then that will make a new command available named SelectOuterLoopsAndDelete. To trigger the command set up a shortcut key and put in the command name which is SelectOuterLoopsAndDelete (note - put in just the plain command name SelectOuterLoopsAndDelete , no extra "script:" at the front, no ".js" at the end).

- 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:  Andrei Samardac
5922.10 In reply to 5922.9 
Thanx a lot
  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:  Andrei Samardac
5922.11 In reply to 5922.10 
Michael I just have one idea how to upgrade this script but I don't know if it's possible.
So the main problem for me working in moi is removing fillet or chamfer, because there is no simple method for this I mean there is a lot of steps you have to make before repair object.
So by using script that you make we can skip some steps, but it would be great to have fully automatible script that will rebuild object.

Script should look like this:
1. Separate surfaces if needed
2. Select all outer loops
3. delete them
4. Trim all surfaces that do not make object
5. Join remained surfaces to make solid where it is possible or joined surfaces.

Is it possible?
  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
5922.12 In reply to 5922.11 
Hi mir43a, I don't think it's really possible to do that level of stuff with a script - it's particularly difficult to do the step where you say "Trim all surfaces" - trimming is not easy to script right now.

In the future I would like to make a more dedicated built in tool that would help with this kind of object repair stuff but for now you would need to be doing all those steps that you describe yourself.

- 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:  Andrei Samardac
5922.13 In reply to 5922.12 
Good Michael, I understood. Could you pleas modify a bit your .js script.

1. Separate selected
2. commands of your script (already made)
2. Run trim comand. (One thing I noticed when I run your script is when it finish its work all faces are deselected, it hase to be selected to run trim command)
  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
5922.14 In reply to 5922.13 
Hi mir4ea, attached here is a modified version that does the separate, delete outer loop, and then runs the trim command.

- 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

Message 5922.15 deleted 30 May 2013 by ANDREI SAMARDAC

Previous
Next
 From:  Andrei Samardac
5922.16 In reply to 5922.14 
Thank you!
  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:  Andrei Samardac
5922.17 In reply to 5922.16 
Michael, this script works very well! It works with joined surface or solids. It will be greate if it works with surfaces too. A this time I have 2 scripts SelectOuterLoopsAndDelete that work with surface and SelectOuterLoopsAndDelete2 that work with joined surface and solids. Could you make pleas SelectOuterLoopsAndDelete2 to work with surfaces too? If selected more than 1 surface it have to run trim if only one than just delete outer loops. It would be good to have one universal script.

EDITED: 30 May 2013 by ANDREI SAMARDAC

  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
5922.18 In reply to 5922.17 
Hi mir4ea, actually the #2 version should also be working with surfaces as well, it does the same thing, removes the outer loop and starts the trim command. Do you mean you do not want it to start the trim command if just one surface was selected? What if multiple surfaces were selected or a mixture of some surfaces and some joined surfaces or solids ?

Or is there some particular surface that is not getting untrimmed as you were expecting?

- 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:  Andrei Samardac
5922.19 In reply to 5922.18 
Michael it dos not work with surfaces at all.
And yes it will be greate to have trimm off when only one surface selected.
  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
5922.20 In reply to 5922.19 
Hi mir4ea, it's working ok with surfaces for me over here. Can you please post a surface that is not working for you?

One thing to note is that if the outer boundary of the surface is already the natural boundary of the "underlying surface" then you won't see anything happen during the untrim, it's only when the outer boundary actually has cut away some material from the underlying surface that you will see anything happen.

You can get an idea of what the underlying surface looks like by turning on the surface control points.

- 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
 

Reply to All Reply to All

 

 
Show messages:  1-20  21-39