Notifications
Clear all

[Closed] Pipes Generator

The clone method is the only way I see fit for this tool, as I want to give users the ability to also do clone/instance.

I understand what you’re saying about the memory leaks and whatnot.

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

i’m pretty far from this problem right now and really don’t have a time to make any tests but maybe…
there’s some idea that came to me recently…
let’s use Editable Spline pieces as the base piece of pipe with… the Substitute modifier on it. what do we get?
#easy geometry
#easy instance cloning
#manageable preview
#easy detection of in-n-out directions
#simple ‘customization’ rules

it sounds cool, doesn’t it?

This has been a very good read so far I been trying to sit down and see if i can implement some of those things on your wishlist to the tool maybe I can bet you to it!

that’s why i’m here on this forum. just sit sometimes and get a fun

yahoo! we are the most fast growing thread by viewing! and the only 2 and the half men make it! go-go-go!

Hahah that is interesting. We have drawn much attention. Much more than I had realized or expected. Where did you see this information at? On the forum main page?

That definitely seems like an interesting idea that has peaked my interest for sure.

I was wondering.
How can I qSort a struct’s ‘Value’ property in order from high/low or low/high

In this case the value can be any number

struct myStuff (node, value, position)

Then return me an array of those objects in order.

no comments

How can I qSort a struct's 'Value' property in order from high/low or low/high

it needs to be more specific… every value type has the best compare solution.

In my situation the ‘value’ is a number which is the result of a distance calculation between an objectA and object B.

I had an example on my computer at work but now I’m at home. But that’s what the value number was.
Does that help?

Hum this is the way I would do it, although you mentioned qSort so you probably tried it already.

fn sortByOrder order1 order2 =
(
	if order1 != undefined and order2 != undefined then
	(
		Order = (order1) > (order2)
		case Order of
		(
			true: 1
			false: -1
			default: 0
		)
	)
	else
	(
		0
	)
)

valueArray = #(10,5,2,4,1,3,6,9,7,8)

qSort valueArray sortByorder
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

this is not correct…

Felipe,
That is sorring an array, I need to sort an array of structs based on one of the structs memebers.

This is dirty but gets the point across.

I take an object and rotate it around it’s z axis in increments of 45 and find which one yields the closest result, position wise, to the target object.


delete objects
pt1 = point pos:[0,0,0] wirecolor:red
pt2 = point pos:[40,0,75] parent:pt1 wirecolor:orange
trgt = point pos:[150,-150,100] wirecolor:yellow

struct ThePoint (node, dist, angle)

--Calculate the rotations
results = #()
for m = 1 to 8 do (
	pt1.transform = (prerotatez  pt1.transform 45)
	dist = distance pt1.children[1].pos trgt.pos
	append results (ThePoint node:pt1 dist:dist angle:(m*45))
 	--append results dist
)

--sort the rotations in an order to find the closest position
fn fnSortValues a b =
(
	local d = a.dist - b.dist
	case of
	(
		(d < 0.): -1
		(d > 0.): 1
		default: 0
	)
)
qsort results fnSortValues

clearlistener()
print results

Page 8 / 12