CGTalk Mini-challenge. Get ordered poly edge loops
reply share thread « Previous Thread | Next Thread »
 Thread Tools Search this Thread Display Modes
05-20-2017, 07:45 PM   #31
aaandres
Matrix3 fighter

portfolio
Andres Fernandez Cruz
Proin3D CEO
Proin3D
Madrid, España

Join Date: Jun 2015
Posts: 477
Quote:
 Originally Posted by denisT hmm... it changes the rule of the original challenge... the original task was to find all loops in ANY edge selection... definitely you can organize your algorithm the way to process 'isolated loops' first. but it's just a step of the solution

I see ... I did not quite understand your requirements.
But my routine seems to work fine and fast for its purpose!
__________________
Andrés FC.
P3D_PathScripts
Proin3D YouTube Channel

 05-21-2017, 07:54 AM #32 aaandres Matrix3 fighter   portfolio Andres Fernandez Cruz Proin3D CEO Proin3D Madrid, España   Join Date: Jun 2015 Posts: 477 I really still don't understand what do you need... How many loops should you get in this schema? http://matap.dmae.upm.es/cursofract...o2/square-g.gif - 2 closed unconnected loops? (then 2 valid solutions and 4 edges not used) - 4 closed loops sharing 1 edge? (then using 4 edges twice in different loops) And in this other one? https://upload.wikimedia.org/wikipe...Example.svg.png You will need to leave unused edges or share them in different loops. __________________ Andrés FC. P3D_PathScripts Proin3D YouTube Channel share quote
05-21-2017, 03:17 PM   #33
denisT
MAX Doctor

portfolio
Denis Trofimov
CA, USA

Join Date: Jul 2009
Posts: 9,871
for picture #1 there two loops minimum....

the algorithm mostly has to solve these loops:

There are two loops on my picture
Attached Images
 Capture2.PNG (6.5 KB, 0 views)

05-21-2017, 06:44 PM   #34
PolyTools3D
Expert

portfolio
Jorge Rodríguez
Argentina

Join Date: Jun 2013
Posts: 1,250
Quote:
 Originally Posted by denisT for picture #1 there two loops minimum.... the algorithm mostly has to solve these loops: There are two loops on my picture
The algorithm I proposed does solve these cases perfectly. It even gives you the two possible solutions, bridged and unbridged paths
And, if the code is optimized, it is very fast.

I get these results using a modified (fixed) version of the code I posted earlier:

Bridged Paths
#(60, 62, 63, 49, 61, 74, 75, 77, 79, 81, 82, 69, 55, 67, 68, 70)
#(36, 38, 40, 41, 28, 11, 26, 39, 52)

Unbridged Paths
#(60, 61, 49, 63, 62, 74, 75, 77, 79, 81, 82, 68, 67, 55, 69, 70)
#(36, 38, 39, 26, 11, 28, 41, 40, 52)
__________________
Jorge Rodríguez
PolyTools3D

Last edited by PolyTools3D : 05-21-2017 at 06:48 PM.

 05-21-2017, 08:28 PM #35 PolyTools3D Expert   portfolio Jorge Rodríguez Argentina   Join Date: Jun 2013 Posts: 1,250 Here is one of the many "hard cases" to solve. It can be solved, but I can't figure out a logic for a 1 or 2 passes solution for it. The challenging part is to pick the correct edge to start. Code: ```( delete objects obj = converttopoly (plane pos:[0,0,1] length:100 width:100 lengthsegs:6 widthsegs:6 wirecolor:yellow isselected:on) obj.selectededges = #{8, 11, 23..25, 27..29, 35..37, 39, 41..43, 51..53, 63..64, 66..67} max modify mode subobjectlevel = 2 )``` If you pick the correct edge to start, then the algorithm I proposed will work it out just perfectly. __________________ Jorge Rodríguez PolyTools3D share quote
05-22-2017, 08:13 AM   #36
aaandres
Matrix3 fighter

portfolio
Andres Fernandez Cruz
Proin3D CEO
Proin3D
Madrid, España

Join Date: Jun 2015
Posts: 477
Quote:
 Originally Posted by PolyTools3D Here is one of the many "hard cases" to solve. It can be solved, but I can't figure out a logic for a 1 or 2 passes solution for it. The challenging part is to pick the correct edge to start. If you pick the correct edge to start, then the algorithm I proposed will work it out just perfectly.

I'm not sure, but:
- If I'm not wrong, you do the calculation of 'neigthbors edges' for each edge. Perhaps you can do it once at the beginning for all the edges and store the result in an array (you can use some sort of dictionnary, as I've done in my routine).
- In your 'FindHeadTail' routine, if there aren't pure 'tail edges', chose those with 2 neigthbors in one side.
- Start with one of them, in the opposite direction of this intersection.
- Add a final function for 'gluing' loops in these intersection points if needed.
__________________
Andrés FC.
P3D_PathScripts
Proin3D YouTube Channel

05-22-2017, 10:21 AM   #37
PolyTools3D
Expert

portfolio
Jorge Rodríguez
Argentina

Join Date: Jun 2013
Posts: 1,250
Quote:
 Originally Posted by aaandres I'm not sure, but: - If I'm not wrong, you do the calculation of 'neigthbors edges' for each edge. Perhaps you can do it once at the beginning for all the edges and store the result in an array (you can use some sort of dictionnary, as I've done in my routine).
The code I posted is much worse than that, trust me It is just a sketch as proof of concept. But the algorithm does work.

So, the code has many bugs, is redundant, and of course not optimized. Even the algorithm misses a few things, which I've found later when working with different scenes. But I think I've solved them.

Quote:
 Originally Posted by aaandres - In your 'FindHeadTail' routine, if there aren't pure 'tail edges', chose those with 2 neigthbors in one side. - Start with one of them, in the opposite direction of this intersection. - Add a final function for 'gluing' loops in these intersection points if needed.
The problem I face is not how to solve it, but how to do it quickly. For example, if the loop is as one of the torus test, we can pick any random edge and that will be fine. But maybe it can't be done the way I would like and it needs to be analyzed differently. Sometime things are just like that. I haven't put too much work on it, so I am still not sure whether there is a better/simple approach.
__________________
Jorge Rodríguez
PolyTools3D

 05-22-2017, 10:28 AM #38 aaandres Matrix3 fighter   portfolio Andres Fernandez Cruz Proin3D CEO Proin3D Madrid, España   Join Date: Jun 2015 Posts: 477 Hi Jorge. No, the first item wasn't an improvement of your code (I'm not able to do that), it's just a way to pre-store neigthbors so you can search for edges that have just 2 connections in one side. __________________ Andrés FC. P3D_PathScripts Proin3D YouTube Channel share quote
05-22-2017, 10:38 AM   #39
PolyTools3D
Expert

portfolio
Jorge Rodríguez
Argentina

Join Date: Jun 2013
Posts: 1,250
Quote:
 Originally Posted by aaandres Hi Jorge. No, the first item wasn't an improvement of your code (I'm not able to do that), it's just a way to pre-store neigthbors so you can search for edges that have just 2 connections in one side.
Ah, I misunderstood the comment.

Yes, for figuring out if there are intersections, I just go thru all the edges and if a vertex appears more than twice we have an intersection.
__________________
Jorge Rodríguez
PolyTools3D

reply share thread

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
 Please select one User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home -------------------- Gallery     Latest Entries     Featured Videos     Featured 3D     Featured 2D     CG Awards     Expose12 Call For Entries (closed) Main     News         Press Releases and Media     General Discussion         Legacy Threads     Off Topic     Recruitment     Education     iMT Xprize Challenge Software     Autodesk Maya         Maya Dynamics         Maya Rendering         Maya Character Setup         Maya Programming     Autodesk Miscellaneous         Autodesk MotionBuilder         Autodesk Mudbox         Autodesk Softimage             XSI: Programming             ICE: Interactive Creative Environment     Autodesk 3ds max         3dsMax SDK and MaxScript         3dsMax Tutorials & Tips         3dsMax Resources         Plugins & Add-ons         Particle Flow     Maxon Cinema 4D         Cinema 4D Resources     The Foundry Modo         The Foundry Time Travel Challenge     Pixologic ZBrush     Photoshop / Painter     Side Effects Houdini     Blender     Lightwave 3D         LW Resources         LW Tutorials     Allegorithmic Substance         Substance Painter         Substance Designer     E-on Software Vue     Compositing Software         The Foundry Nuke         Adobe After Effects         Autodesk Effects and Compositing         Eyeon Software Digital Fusion Challenges     Modeling Challenge         Member Model Collection     Digital Matte Painting Challenge     Rigging Challenge     Sketch Challenge         Member SKETCH Collection     FXWARS Challenge         Member FXGallery     Animation Challenge         Past Sessions Archive     Lighting Challenges WIP     Professional Feedback     WIP/Critique: 3D     WIP/Critique: 2D         Speedpaints & Sketchbooks     WIP/Critique: Animation     Collaborative Projects Techniques     Art Techniques and Theories     Digital Matte Painting         Digital Matte Painting Mini-Challenge     Modeling     Texturing and Surfacing     Character Rigging     Animation     Lighting and Shaders     Compositing and Editing     Anatomy and Figurative Art         SPOTLIGHT: Best of the Artistic Anatomy and Figurative Art Forum         Tutorials and Workshops         Personal Anatomy & Sketchbook Threads         References, Resources, and Supplies Technical     Virtual Reality     Game Engine     Graphics Programming     Technical and Hardware
Miscellaneous

All times are GMT. The time now is 11:37 PM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.