connecting all points to all other points

   8321   11   0
User Avatar
Member
121 posts
Joined: July 2005
Offline
Hi,

is there any way to connect all points of an object with all other points in the object?

Is there a way to procedurally split a curve which consists of, let's say 1 primitive and 5 points into a curve that consists of 4 primitives (and 8 points).
Basicly I just want each segment of a curve to be a primitive for it's own.

Thanks again,
Achim
User Avatar
Member
412 posts
Joined: July 2005
Offline
hey achim,

you should be able to do this through a couple quick adds and sorts.. here's an example file of how i went about doing it.. you can replace that curve with any curve of your liking and it should still get you what you need…

Example HIP [studentpages.scad.edu]
Dave Quirus
User Avatar
Member
412 posts
Joined: July 2005
Offline
oops.. just reread your post and noticed you wanted individual points along the curve as well as prims.. a facet with unique points at the bottom of the chain should do that for you..
Dave Quirus
User Avatar
Member
121 posts
Joined: July 2005
Offline
hey dave,

thank you, nice idea with the two add sops. It just has problem with input curves with an even number of point, as it will connect the last to the first point then. I managed to fix this with a dissolve sop and p0-`npoints(“../thecurve”)`. So this is working now

Any ideas about the connect all points to all others question?
User Avatar
Member
121 posts
Joined: July 2005
Offline
figured it out copy stamping does the trick
User Avatar
Member
136 posts
Joined: July 2005
Offline
Is this what u want?
http://www.cgtalk.ru/forum/attachment.php?attachmentid=3077 [cgtalk.ru]
User Avatar
Member
121 posts
Joined: July 2005
Offline
Hi Andrew,

yes, that's basicly what I want, though Dave's solution outputs cleaner Geometry. In your file, if you apply a carve sop you see what I mean. But thanks for your file!


By the way, here's the solution for the interconnection stuff

[code]
# Automatically generated script: Friday September 16, 12:47
\set noalias = 1
set saved_path = `execute(“oppwf”)`
opcf /obj

# Node connect
opadd -n geo connect
oplocate -x 1.7973 -y 2.4 connect
opset -S on connect
opparm connect use_dcolor ( off )
chautoscope connect +tx +ty +tz +rx +ry +rz +sx +sy +sz +px +py +pz +scale
opset -d on -r off -h off -f off -y off -t off -l off -s off -u off -c off -C on -p off -e on -b off -x off connect
opcf connect

# Node grid1
opadd -n grid grid1
oplocate -x -2.61235 -y 5.74556 grid1
opparm grid1 rows ( 2 ) cols ( 2 )
opset -d off -r off -h off -f off -y off -t off -l off -s off -u off -c off -C off -p off -e on -b off grid1

# Node dissolve1
opadd -n dissolve dissolve1
oplocate -x -2.61235 -y 4.62056 dissolve1
opparm dissolve1 group ( p0-1-3-2-0 ) remunusedpts ( off )
opset -d off -r off -h on -f off -y off -t off -l off -s off -u off -c off -C off -p off -e on -b off dissolve1

# Node add1
opadd -n add add1
oplocate -x -5.11235 -y 5.07056 add1
opparm add1 points ( 3 ) usept0 ( on ) pt0 ( 0 1 0 ) pt1 ( 0 -0.9 0 ) pt2 ( -1.3 0.5 0 )
opset -d off -r off -h off -f off -y off -t off -l off -s off -u off -c off -C off -p off -e on -b off add1

# Node merge1
opadd -n merge merge1
oplocate -x -3.86235 -y 3.64556 merge1
opset -d off -r off -h off -f off -y off -t off -l off -s off -u off -c off -C off -p off -e on -b off merge1

# Node conn
opadd -n copy conn
oplocate -x 6.13765 -y 6.72056 conn
chblockbegin
chadd -t 0 0 conn ncy
chkey -t 0 -v 1 -m 0 -A 0 -F ‘ch(“../main/ncy”)-1-stamp(“../main”, _CY,0)’ conn/ncy
chadd -t 0 0 conn val1
chkey -t 0 -v 0 -m 0 -A 0 -F ‘point(“../null1”, stamp(“../main”, _CY,0), “P”,0)’ conn/val1
chadd -t 0 0 conn val3
chkey -t 0 -v 0 -m 0 -A 0 -F ‘point(“../null1”, stamp(“../main”, _CY,0), “P”,2)’ conn/val3
chadd -t 0 0 conn val2
chkey -t 0 -v 0 -m 0 -A 0 -F ‘point(“../null1”, stamp(“../main”, _CY,0), “P”,1)’ conn/val2
chadd -t 0 0 conn val5
chkey -t 0 -v 0 -m 0 -A 0 -F ‘point(“../null1”, stamp(“../main”, _CY,0)+$CY+1 ,“P”,1)’ conn/val5
chadd -t 0 0 conn val6
chkey -t 0 -v 0 -m 0 -A 0 -F ‘point(“../null1”, stamp(“../main”, _CY,0)+$CY+1 ,“P”,2)’ conn/val6
chadd -t 0 0 conn val4
chkey -t 0 -v 0 -m 0 -A 0 -F ‘point(“../null1”, stamp(“../main”, _CY,0)+$CY+1 ,“P”,0)’ conn/val4
chblockend
opparm conn stdswitcher ( 1 1 1 ) ncy ( ncy ) stamp ( on ) param1 ( x ) val1 ( val1 ) param2 ( y ) val2 ( val2 ) param3 ( z ) val3 ( val3 ) param4 ( x2 ) val4 ( val4 ) param5 ( y2 ) val5 ( val5 ) param6 ( z2 ) val6 ( val6 )
opset -d off -r off -h off -f off -y off -t off -l off -s off -u off -c off -C off -p off -e on -b off conn

# Node points
opadd -n add points
oplocate -x 6.13765 -y 7.84556 points
chblockbegin
chadd -t 0 0 points pt0x
chkey -t 0 -v 0 -m 0 -A 0 -F ‘stamp(“../conn”, x,0)’ points/pt0x
chadd -t 0 0 points pt0y
chkey -t 0 -v 0 -m 0 -A 0 -F ‘stamp(“../conn”, y,0)’ points/pt0y
chadd -t 0 0 points pt0z
chkey -t 0 -v 0 -m 0 -A 0 -F ‘stamp(“../conn”, z,0)’ points/pt0z
chadd -t 0 0 points pt1x
chkey -t 0 -v 0 -m 0 -A 0 -F ‘stamp(“../conn”, x2,0)’ points/pt1x
chadd -t 0 0 points pt1y
chkey -t 0 -v 0 -m 0 -A 0 -F ‘stamp(“../conn”, y2,0)’ points/pt1y
chadd -t 0 0 points pt1z
chkey -t 0 -v 0 -m 0 -A 0 -F ‘stamp(“../conn”, z2,0)’ points/pt1z
chblockend
opparm points stdswitcher ( 1 1 ) points ( 2 ) switcher ( 1 1 ) usept0 ( on ) pt0 ( pt0x pt0y pt0z ) usept1 ( on ) pt1 ( pt1x pt1y pt1z )
opset -d off -r off -h off -f off -y off -t off -l off -s off -u off -c off -C off -p off -e on -b off points

# Node main
opadd -n copy main
oplocate -x 6.13765 -y 5.59556 main
chblockbegin
chadd -t 0 0 main ncy
chkey -t 0 -v 1 -m 0 -A 0 -F ‘npoints(“../null1”)’ main/ncy
chadd -t 0 0 main val1
chkey -t 0 -v 0 -m 0 -A 0 -F ‘$CY’ main/val1
chblockend
opparm main ncy ( ncy ) stamp ( on ) param1 ( _CY ) val1 ( val1 )
opset -d off -r off -h off -f off -y off -t off -l off -s off -u off -c off -C off -p off -e on -b off main

# Node null1
opadd -n null null1
oplocate -x -1.04985 -y 1.09556 null1
opset -d off -r off -h off -f off -y off -t off -l off -s off -u off -c off -C off -p off -e on -b off null1

# Node scatter1
opadd -n scatter scatter1
oplocate -x 1.76265 -y 3.19556 scatter1
opparm scatter1 npts ( 7 )
opset -d off -r off -h off -f off -y off -t off -l off -s off -u off -c off -C off -p off -e on -b off scatter1

# Node sphere1
opadd -n sphere sphere1
oplocate -x 1.76265 -y 4.32056 sphere1
opset -d off -r off -h off -f off -y off -t off -l off -s off -u off -c off -C off -p off -e on -b off sphere1

# Node fuse1
opadd -n fuse fuse1
oplocate -x 6.13765 -y 4.47056 fuse1
opset -d on -r on -h off -f off -y off -t off -l off -s off -u off -c off -C off -p off -e on -b off fuse1

# Node switch1
opadd -n switch switch1
oplocate -x -1.04985 -y 2.22056 switch1
opparm switch1 input ( 1 )
opset -d off -r off -h off -f off -y off -t off -l off -s off -u off -c off -C on -p off -e on -b off switch1
oporder -e grid1 dissolve1 add1 merge1 conn points main null1 scatter1 sphere1 fuse1 switch1
opcf ..

opcf /obj
opcf connect
opwire -n grid1 -0 dissolve1
opwire -n add1 -0 merge1
opwire -n dissolve1 -1 merge1
opwire -n points -0 conn
opwire -n conn -0 main
opwire -n switch1 -0 null1
opwire -n sphere1 -0 scatter1
opwire -n main -0 fuse1
opwire -n merge1 -0 switch1
opwire -n scatter1 -1 switch1
opcf ..
opcf $saved_path
User Avatar
Member
2199 posts
Joined: July 2005
Online
You might also want to try using a carve sop with set first U to 0 and last to 1 then turned on breakpoints and cut at all internal breakpoints
The trick is finding just the right hammer for every screw
User Avatar
Member
412 posts
Joined: July 2005
Offline
well damn.. look at that.. forget my solution.. simon's suggestion works like a charm and does it all in one sop..
Dave Quirus
User Avatar
Member
2199 posts
Joined: July 2005
Online
Actually I confess I got this off someone else, it came up on the forum ages ago and I stored it away in the old memory bank filed under “so that's what that button is for”
The trick is finding just the right hammer for every screw
User Avatar
Member
412 posts
Joined: July 2005
Offline
Dave Quirus
User Avatar
Member
121 posts
Joined: July 2005
Offline
Thanks a lot Dave and Simon
  • Quick Links