CGTalk > Software Specific Forums > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 03-27-2013, 03:52 PM   #1
bntheman
Veteran
portfolio
Bob Bob
clemeton, US
 
Join Date: Aug 2011
Posts: 59
Intersecting Curves

Hi y'all. I am writting a mel script which will be able to creat city/road networks. My projection of plan is for the user to map out the network using the ep curve, and then with another ep curve that will define the defualt width of the roads. Once the roads are created, the road network will be interacticve, allowing the user to make changes or adjustments. So far, I was able to develop the part that duplicates the defined road width curve. My problem I am having now is with creating the intersecting roads. My therory I think the script needs to know is for knowing where the roads intersect with each other and the road intersection style, meaning is it a "T" intersection or a "+" intersection etc.

I have created snapped shot an example of what I am refering to...
....note the read curves are the curves I am looking for the script to find.

Does anyone have aany ideas? I tried using the curveIntersect but all I get is a bunch of numbers.

Last edited by bntheman : 03-27-2013 at 03:58 PM.
 
Old 03-28-2013, 10:33 AM   #2
Hamburger
Expert
portfolio
Where is it?
Architectural Viz
Australia
 
Join Date: Sep 2004
Posts: 1,985
Sounds like an interesting project, I'm no scripter, but I know of this one posted by SebKain a few years ago which gives a world coordinate output.

http://forums.cgsociety.org/showpos...835&postcount=3

Maybe it is of use to you.
 
Old 03-28-2013, 02:25 PM   #3
bntheman
Veteran
portfolio
Bob Bob
clemeton, US
 
Join Date: Aug 2011
Posts: 59
I have seen that previously, but I am not really positive this will help me. The problem I am afraid that might happen is with the multiple "network curves", whom defines the road network, will be in order. For example, using the above image again, assuming that the name of the curve to the left is curve1, the curve on the right is curve21, and the curve in between is curve13.

now the selection list is going to hold all of the "network curves" so... the order you might get is....

curve1, curve45, curve2, curve3, curve13, curve10, curve11, curve21

now, if I take the first 3 selections...
curves1, curve45, curve2 do not intersect with each other, which means that I would need to do a loop for each curve... as

ummm.......

I think I see something in my first post that maybe is confusing some of you...

Let me make it clear that the script I am focusing on will be a one time deal. Meaning, the user selects all of the "network curves" and clicks on add network curves button, then selects the curve that defines the road width and clicks on add road object button. Once both parts are defined, the user clicks on build road network. The script will then break up any neccessary peices, loop through each network curve and creating the roads based on the selected defined road width object. So I think where the confusion is coming might be poeple thinking the user will be selecting the correct curves, which is not true. this is all procedural.
 
Old 04-02-2013, 02:15 PM   #4
bntheman
Veteran
portfolio
Bob Bob
clemeton, US
 
Join Date: Aug 2011
Posts: 59
a few updates....
when I orginally called curveIntersect, I did not turn on construction history. Therefore, I would not get an intersect node. The intersect node is usefull because it holds the inputs of the 2 intersected curves. However, I cannot seem to get ls -sl list show the intersect nodes.

Also, I will be uploading here an update of my duplicate along path script. I was doing pretty good with it untill Maya had crashed, and I lost my last updated script. So I am trying to remember how I fixed the broken script.

Yes I know there are already a few duplate path scripts out there, but this one is designed to evenly divide the number of duplicates, and allow the user to interactivly adjust the spacing between after the motionpath and snapshot have been created.
 
Old 04-12-2013, 01:35 PM   #5
bntheman
Veteran
portfolio
Bob Bob
clemeton, US
 
Join Date: Aug 2011
Posts: 59
So as promised, here is my duplication part of the script so far. The basic gist is to create an ep curve path and an object. Once the script starts, a window will pop up allowing you to pick which is the curved path and which is the object. Then it is as simple as clicking on the create duplicates button.

However, if anyone can help me to continue, I am really having a problem with getting the attributes of curveIntersect node inputCurve1 and inputCurve2.

Code:
string $cIntersect[] = `ls -type curveIntersect`; for($i = 0; $i < size($cIntersect); $i++) { string $input1 = `getAttr ($cIntersect[$i] +".inputCurve1")`; string $input2 = `getAttr ($cIntersect[$i] +".inputCurve2")`; print($input1); print($input2); print("\n\n"); }


however, I get an error stating...

The data is not a numeric or string value, and cannot be displayed.
 
Old 04-12-2013, 01:35 PM   #6
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 03:07 PM.


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