Loop in complex objects

Next
 From:  Phiro
10262.1 
Does exist a possibility to select a loop on faceted objects ?

I use some complex files with many faces and I want to select a loop of continious egdes.
I don't seach for a loop of a single face but a loop of many edges which follows a path.
This sample is very simple but files are sometimes very much complex.

The goal is to redo a new path to have soft an clean nurbs at the end.


  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)
10262.2 In reply to 10262.1 
Seems there is that in the free Rocket 3F (I have not yet verifyed now)
https://rocket3f.com

As it's as direct Import Export to Moi in the 2 ways you will have the impression to not leave Moi! ;)
---
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:  Frenchy Pilou (PILOU)
10262.3 
Sorry seems i had dreamed there are exotic selections but not that you want! :(
---
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:  Michael Gibson
10262.4 In reply to 10262.1 
Hi Phiro, try putting this on a keyboard shortcut:

script: /* Extend edge selection one step */ var angle_degrees = 20; var cos_ang = Math.cos(angle_degrees * Math.PI / 180.0); var edges = moi.geometryDatabase.getSelectedObjects().getEdges(); for ( var i = 0; i < edges.length; ++i ) { var e = edges.item(i); var ptA = e.getStartPt(); var ptB = e.getEndPt(); var done = []; var faces = e.getFacesOfEdge(); while ( faces.length> 0 ) { var f = faces.item( faces.length-1 ); faces.removeObjectAt( faces.length-1 ); if ( done[f.id] ) continue; done[f.id] = true; var edges2 = f.getEdges(); for ( var j = 0; j < edges2.length; ++j ) { var e2 = edges2.item(j); var ptC = e2.getStartPt(); var ptD = e2.getEndPt(); var tol = 1.0e-6; var A = false, B = false, C = false, D = false; if ( moi.vectorMath.distance( ptA, ptC ) < tol ) { A = true; C = true; } else if ( moi.vectorMath.distance( ptA, ptD ) < tol ) { A = true; D = true; } else if ( moi.vectorMath.distance( ptB, ptC ) < tol ) { B = true; C = true; } else if ( moi.vectorMath.distance( ptB, ptD ) < tol ) { B = true; D = true; } if ( A || B ) { var tan_e = e.evaluateTangent( A ? e.domainMin : e.domainMax ); var tan_e2 = e2.evaluateTangent( C ? e2.domainMin : e2.domainMax ); if ( Math.abs( (tan_e.x * tan_e2.x) + (tan_e.y * tan_e2.y) + (tan_e.z * tan_e2.z) )> cos_ang ) e2.selected = true; var faces2 = e2.getFacesOfEdge(); for ( var k = 0; k < faces2.length; ++k ) { var f2 = faces2.item(k); if ( !done[f2.id] ) faces.addObject( f2 ); } } } } }

That should expand an edge selection to neighboring edges that are within a 20 degree angle.

- 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
10262.5 In reply to 10262.4 
And here's a version that will grab a longer chain in one go:

script : /* Extend edge selection */ var angle_degrees = 20; var cos_ang = Math.cos( angle_degrees * Math.PI / 180.0 ); var done_edges =[]; while ( 1 ) { var any_change = false; var edges = moi.geometryDatabase.getSelectedObjects().getEdges(); for ( var i = 0; i < edges.length; ++i ) { var e = edges.item(i); if ( done_edges[e.id] ) continue; done_edges[e.id] = true; var ptA = e.getStartPt(); var ptB = e.getEndPt(); var done_faces = []; var faces = e.getFacesOfEdge(); while ( faces.length> 0 ) { var f = faces.item( faces.length-1 ); faces.removeObjectAt( faces.length-1 ); if ( done_faces[f.id] ) continue; done_faces[f.id] = true; var edges2 = f.getEdges(); for ( var j = 0; j < edges2.length; ++j ) { var e2 = edges2.item(j); var ptC = e2.getStartPt(); var ptD = e2.getEndPt(); var tol = 1.0e-6; var A = false, B = false, C = false, D = false; if ( moi.vectorMath.distance( ptA, ptC ) < tol ) { A = true; C = true; } else if ( moi.vectorMath.distance( ptA, ptD ) < tol ) { A = true; D = true; } else if ( moi.vectorMath.distance( ptB, ptC ) < tol ) { B = true; C = true; } else if ( moi.vectorMath.distance( ptB, ptD ) < tol ) { B = true; D = true; } if ( A || B ) { var tan_e = e.evaluateTangent( A ? e.domainMin : e.domainMax ); var tan_e2 = e2.evaluateTangent( C ? e2.domainMin : e2.domainMax ); if ( Math.abs( (tan_e.x * tan_e2.x) + (tan_e.y * tan_e2.y) + (tan_e.z * tan_e2.z) )> cos_ang ) { if ( !e2.selected ) { e2.selected = true; any_change = true; } } var faces2 = e2.getFacesOfEdge(); for ( var k = 0; k < faces2.length; ++k ) { var f2 = faces2.item(k); if ( !done_faces[f2.id] ) faces.addObject( f2 ); } } } } } if ( !any_change ) 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:  Phiro
10262.6 
Hi,

@Michael
Thanks a lot, Many time saved with this script... I knew it, but confirmed, you are a genious
It's very usefull to work with other soft or online services, like http://hypatiastudio.com/celticknots/ or to rework on exports.


@Pilou
I tested the Rocket3D loop, but Rocket3d is very cool but faces oriented, so i don't find how to export curves.

A before / After screenshot...


  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)
10262.7 In reply to 10262.6 
<< Export curve
I believe you must export object then extract curves in Moi! ;)

It's the limitation of the OBJ format

but you have the export DXF ! ;)

Seems not working inside Moi :(

So I use the free astonished PCONPlanner https://pcon-planner.com

Import inside the DXF from Rocket 3F then export inside Moi DXF that works! :)

EDITED: 1 Apr 2021 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:  Frenchy Pilou (PILOU)
10262.8 
Cool scripts !

@ Phiro
You don't want a selection of a loop edges one out of two ? Or i dreamed again ? :)

PS You have also Construct / Curve / Silhou who can give some interesting results! ;)
(just very few edges/points to erase /Add for have a complete loop)
with your file

EDITED: 1 Apr 2021 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:  Frenchy Pilou (PILOU)
10262.9 
  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)
10262.10 
@Phiro
Very cool prog the Hypatia onLine ! :)

Save as stl : Mesh mixer --> OBJ

Import in Moi by Native SUBD / Create from File or _importOBJ by Max SMirnov

EDITED: 2 Apr 2021 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
 From:  Cemortan_Tudor
10262.11 
- Tudor -
  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