PolyTools3D
@polytools3d
New Member
Joined: Feb 14, 2024
Topics: 17 / Replies: 1674
Reply
RE: The Challenge >>> Limit number of non-zero items of array by specified count

I arrived to a similar one but 2X faster. But I still need to deal with arrays containing 0.0, and the heap usage is the same due to the point2 array.

5 years ago
Forum
Reply
RE: The Challenge >>> Limit number of non-zero items of array by specified count

This one is around 35% faster. ( fn LimitArray arr limit = ( if limit < arr.count and limit != 0 do ( tmp = sort (deepcopy arr) …

5 years ago
Forum
Reply
RE: The Challenge >>> Limit number of non-zero items of array by specified count

Ok, since the rules changed significantly, here is a modified version of my previous algorithm, which is a lot slower. How does it performs for you D…

5 years ago
Forum
Reply
RE: The Challenge >>> Limit number of non-zero items of array by specified count

And here is the test array: ( /* Build test array ———————————– */ gc() seed 0 arr = for j = 1 to 15000 collect random -1…

5 years ago
Forum
Reply
RE: The Challenge >>> Limit number of non-zero items of array by specified count

Here is my version, but as Denis stated there will be “not unique” numbers, it won’t work. fn LimitArray arr limit = ( if limit < arr.count and l…

5 years ago
Forum
Reply
RE: The Challenge >>> Limit number of non-zero items of array by specified count

Is that the time to build the test array or to process it with the algorithm you propose? I was asking for the time it takes to process the array with…

5 years ago
Forum
Reply
RE: The Challenge >>> Limit number of non-zero items of array by specified count

denisT: There are some rules I forgot to say: #1 The order is matter. It has to stay the same. #2 The array can be not unique. It has to stay the …

5 years ago
Forum
Reply
RE: The Challenge >>> Limit number of non-zero items of array by specified count

Nice that you included the 0.0 in the example. What time do you get for this ? ( seed 0 limit = 5000 arr = for j = 1 to 15000 collect random -…

5 years ago
Forum
Reply
RE: A query about trimesh selections

denisT: But we can change the triangle 2 to different order – [4,3,2] for example. That would also flip the face normal. ( obj = converttomesh…

5 years ago
Forum
Reply
RE: Add a point to an array

vector = [1,0,0] <node>.dir = vector

5 years ago
Forum
Reply
RE: Add a point to an array

You first have to create the array in order to then add items to it. pos_array = #() look_array = #() append pos_array point_1 append look_array poi…

5 years ago
Forum
Reply
RE: How to set dotnet combobox dropdown amount?

Try: <control>.DropDownHeight <control>.DropDownHeight = (<control>.Items.Count+1) * <control>.ItemHeight

5 years ago
Forum
Reply
RE: Detecting last resize event

gandhics: I guess I can control the interval number? Sure, you can use the one you define at rollout setup of modify it anytime later, as well as…

5 years ago
Forum
Reply
RE: Detecting last resize event

Does this work for what you need? ( try destroydialog ::RO_TEST catch() rollout RO_TEST “” width:200 height:200 ( timer clock “” interval:100 ac…

5 years ago
Forum
Reply
RE: Detecting last resize event

Well, that changes the things. Although I have to say it is an uncommon behavior what you are seeking (IMO). I’ve never seen such a behavior in a dial…

5 years ago
Forum
Page 13 / 113