Select flat, face selection to edge

Next
 From:  rolnxyz
10085.1 
Hi fam,

Got two questions about selections:

1. Is there a way / script to convert a face selection to its corresponding curve line outline?



2. Is there a way to select all continuous faces in of object within an angle threshold? Many polymodeling programs have this, like cinema4d phong break selection, or RizomUV wand selection, or blender select linked faces. I'm trying to quickly select faces without having to click too much.



I know the example isn't the best because it's an obj file imported via ImpObj, but I've come across this issue when doing NURBS modeling quite a few times and wonder if someone knows how to do it.

Thanks.

  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:  Frenchy Pilou (PILOU)
10085.2 In reply to 10085.1 
Use the rectangle selection from left to right! ;)
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel Gallery
  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:  rolnxyz
10085.3 In reply to 10085.2 
Thanks PILOU, yea rectangle selection left to right works for this case (it's what I used to make the selection in the screenshot), which is why I wished I had a better example to show you. Many times I find myself selecting things I didn't mean to when I use that approach, which ends up requiring many clicks / cleanup.
  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:  Frenchy Pilou (PILOU)
10085.4 In reply to 10085.3 
In general Click something (Point (not control pts), segment (edge), surface will select only this nature selected with your general selection!

Use also the Type Selector Browser!

EDITED: 28 Dec 2020 by PILOU

  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:  bemfarmer
10085.5 
It is hard to know just what you are needing.
A few shortcut possibilities:

script:/*!Select edges v1.2 */ var gd = moi.geometryDatabase; function sl(o) { for ( var i = 0; i < o.length; ++i ) { o.Item(i).selected = 0; var e=o.Item(i).getEdges(); for ( var j = 0; j < e.length; ++j ) e.Item(j).selected = !e.Item(j).selected;}} gd.selectLoop(); var so = gd.getSelectedObjects(); var e = so.getEdges(); sl(so.getFaces()); sl(so.getSolids()); so.getBReps().setProperty('selected',0); e.setProperty('selected',1);

script:/* wireframe v1.0 */ var gd = moi.geometryDatabase; var so=gd.getSelectedObjects(); if (so.length>0) { so.setProperty( 'displayMode',1); so.setProperty( 'selected', 0); } else { gd.getObjects().setProperty( 'displayMode',0); }

script: /* switch selection from selected faces to edges on those faces adjacent to unselected faces */ var gd = moi.geometryDatabase; var seledges = moi.geometryDatabase.createObjectList(); var faces = gd.getSelectedObjects().getFaces(); for ( var i = 0; i < faces.length; ++i ) { var edges = faces.item(i).getEdges(); for ( var j = 0; j < edges.length; ++j ) { var edge = edges.item(j); var allselected = true; var facesofedge = edge.getFacesOfEdge(); for ( var k = 0; k < facesofedge.length; ++k ) { if ( !facesofedge.item(k).selected ) { allselected = false; } } if ( !allselected || facesofedge.length == 1 ) { seledges.addObject( edge ); } } } gd.deselectAll(); seledges.setProperty( 'selected', true );

script: /* switch selection from a face to its edges */ var gd = moi.geometryDatabase; var faces = gd.getSelectedObjects().getFaces(); gd.deselectAll(); for ( var i = 0; i < faces.length; ++i ) faces.item(i).getEdges().setProperty( 'selected', true );

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; } } } }


- Brian

EDITED: 30 Dec 2020 by BEMFARMER

  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:  rolnxyz
10085.6 In reply to 10085.5 
Hey bemfarmer, I think something went wrong when you were pasting the scripts. You seem to only be declaring a variable "gd". Can you post them again? You have me intrigued, those comments describe useful operations.
  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:  rolnxyz
10085.7 
Found the script to outline a polygon selection:

script: /* Select edges v1.4 */ var gd=moi.geometryDatabase, so=gd.getSelectedObjects(); function ss(o,v){o.setProperty("selected",v)} function sl(o){ for ( var i=0; i<o.length; ++i ) o.item(i).getEdges().invertProperty("selected");} gd.selectLoop(); sl(so.getFaces()); sl(so.getSolids()); sl(so.getOpenBReps()); sl(so.getSingleFaceBReps()); ss(so.getBReps(),0); ss(so.getFaces(),0);
  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
10085.8 In reply to 10085.1 
Hi rolnxyz,

re:
> 1. Is there a way / script to convert a face selection to its corresponding curve line outline?

It looks like you found this one already? There is another version here too:
http://moi3d.com/forum/index.php?webtag=MOI&msg=5922.37


> 2. Is there a way to select all continuous faces in of object within an angle threshold? Many
> polymodeling programs have this, like cinema4d phong break selection, or RizomUV wand selection,
> or blender select linked faces. I'm trying to quickly select faces without having to click too much.

Right but MoI is not a poly modeling program and isn't designed to work on faceted model geometry like you have here. You're much better off doing this type of poly modeling in a program that's designed to do that type of work like cinema4d, blender, etc... like you mention.

For the Window selection method, drag the window in a view where you're looking straight down on the face, that will make it easier to capture them all in one window:



It should be possible though to make a script that will grow selection to adjacent faces that are coplanar. I'll see about cooking one up for that.

- 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
10085.9 In reply to 10085.1 
Hi rolnxyz, here are some scripts that might help.

First one - grow face selection to one neighboring face that is coplanar with the current face selection:

script: /* Grow face selection to neighboring coplanar faces */ var faces = moi.geometryDatabase.getSelectedObjects().getFaces(); for ( var i = 0; i < faces.length; ++i ) { var f = faces.item(i); var edges = f.getEdges(); for ( var j = 0; j < edges.length; ++j ) { var e = edges.item(j); var faces2 = e.getFacesOfEdge(); for ( var k = 0; k < faces2.length; ++k ) { var f2 = faces2.item(k); if ( f2.id != f.id && f2.isPlanar && f.isPlanar && f.isOnPlane( f2.planarFrame ) ) f2.selected = true; } } }

Second one - grow face selection to all neighboring faces that are coplanar with the current face selection:

script: /* Grow face selection to multiple neighboring coplanar faces */ while ( true ) { var did_one = false; var faces = moi.geometryDatabase.getSelectedObjects().getFaces(); for ( var i = 0; i < faces.length; ++i ) { var f = faces.item(i); var edges = f.getEdges(); for ( var j = 0; j < edges.length; ++j ) { var e = edges.item(j); var faces2 = e.getFacesOfEdge(); for ( var k = 0; k < faces2.length; ++k ) { var f2 = faces2.item(k); if ( f2.id != f.id && f2.isPlanar && f.isPlanar && f.isOnPlane( f2.planarFrame ) ) if ( !f2.selected ) { f2.selected = true; did_one = true; } } } } if ( !did_one ) break; }

- 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:  rolnxyz
10085.10 In reply to 10085.9 
That's awesome Michael, thanks for the scripts!
  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:  Chris (CHRISTOPHER021)
10085.11 In reply to 10085.9 
thx you for these !!
  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:  Frenchy Pilou (PILOU)
10085.12 
BY Max SMirnov
Increase selection

script: function es(edg){ var i,f; for (i=0; i<edg.length; i++) {f=edg.item(i).getFacesOfEdge(); f.setProperty('selected',1);}} var so = moi.geometryDatabase.getSelectedObjects(), sf=so.getFaces(), i; for ( i=0; i<sf.length;i++) es(sf.item(i).getEdges()); es(so.getEdges());

Decrease sélection
script: function es(edg){ var i,f; for (i=0; i<edg.length; i++) {f=edg.item(i).getFacesOfEdge(); f.setProperty('selected',0);}} var gd = moi.geometryDatabase; gd.invertSelection(); var so = gd.getSelectedObjects(), sf=so.getFaces(), i; gd.invertSelection(); for ( i=0; i<sf.length;i++) es(sf.item(i).getEdges());
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel Gallery
  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