Intersecting Curves

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  03 March 2013
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 March 2013 at 03:58 PM.
  03 March 2013
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.

Maybe it is of use to you.
  03 March 2013
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


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.
  04 April 2013
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.
  04 April 2013
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.

string $cIntersect[] = `ls -type curveIntersect`;

for($i = 0; $i < size($cIntersect); $i++) {
    string $input1 = `getAttr ($cIntersect[$i] +".inputCurve1")`;
    string $input2 = `getAttr ($cIntersect[$i] +".inputCurve2")`;

however, I get an error stating...

The data is not a numeric or string value, and cannot be displayed.
  04 April 2013
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

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
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 10:29 PM.

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