Replace in place?

Next
 From:  Frenchy Pilou (PILOU)
3974.1 
Does it possible to have this?

Say simple 5 red volumes
one complex green volume
Replace these 5 "cubes" by the complex green volume so 5 green complex volumes
(cubes can be different)

the same but but with a family of volumes?
here familly= a complex green volume + one orange cone
so result will be if not randomly
complex volume, cone, complex volume, cone, complex volume
or randomly
maybe cone, cone, complex volume, cone, cone

EDITED: 13 Jan 2011 by PILOU

Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3974.2 In reply to 3974.1 
Hi Pilou, I'm not sure if this is exactly what you need, but Petr wrote a custom command here:
http://kyticka.webzdarma.cz/3d/moi/#CopyToPoints
which allows you to copy an object from a base point to a set of point objects.


You can also place a point object at the center of the selected object's bounding box by using the BoundingBoxCenter command:
http://moi3d.com/2.0/docs/moi_command_reference10.htm#boundingboxcenter


Maybe these in combination with one another will get you what you need - for randomness maybe that previous random selection script could be used to make a randomized selection of the points to copy to:
http://moi3d.com/forum/index.php?webtag=MOI&msg=3927.2


One problem you may run into is that when multiple objects are selected, the BoundingBoxCenter command puts just one point at the center of the combined bounding box rather than around each object individually. Here is a script that you can use to do that though - this script puts a point at the center of each individual selected object:

script: /* Place a point at each selected object's bounding center */ var objs = moi.geometryDatabase.getSelectedObjects(); for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); var pt = obj.getBoundingBox().center; var ptfactory = moi.command.createFactory( 'point' ); ptfactory.setInput( 0, pt ); ptfactory.commit(); }


So use this script to place the target points (randomize the selection if you want first), delete the objects, and then use Petr's command to copy a new object to those points.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
3974.3 In reply to 3974.2 
hehe that is a cool approach
that will can works for some funny thing!

ps and thx for this tricky script ;)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
3974.4 In reply to 3974.2 
Ps Randomly was for the objects, not for the position who was fixed ;)

Say a dice (6 faces) so 24 orthonormal position / origine
if I draw some cubes in the space (so "points")
dices will be affect randomly to the points :)
here for example 9 objects (cubes) so 9 points with your method :)
I must affect manualy in this case ;)
but your advice above is yet a beginning !




EDITED: 13 Jan 2011 by PILOU

Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3974.5 In reply to 3974.4 
Hi Pilou,

> Ps Randomly was for the objects, not for the position who was fixed ;)

Right, so from what I understood you wanted to only replace some random quantity of the objects and not necessarily all of them.

The steps that I was talking about above should do that:
quote:
So use this script to place the target points (randomize the selection if you want first), delete the objects, and then use Petr's command to copy a new object to those points.


If you don't want to replace all objects but only some random subset of them, start with all of the target objects selected, then use that randomize selection script which will deselect some random objects (and so those deselected will not be replaced), and then continue on with the steps to replace just the remaining selected objects.

If that's not the kind of randomness that you need, I guess I'll need some additional explanation.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
3974.6 In reply to 3974.5 
I want replace all objects with a family of other objects (who can be any number of objects) :)
example above was
5 red objects --> 5 green objects = 5 (family= one object)
5 red object -->3 cones + 2 green objects=5 (family=2 objects in order or randomly)

with dices that can be
5 red object --> 5 dices = 5 (but with any of the 24 possible positions family= 24 objects )

is that more clear? :)

EDITED: 13 Jan 2011 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3974.7 In reply to 3974.4 
Hi Pilou, here is are the steps that I'm talking about.

Say you have a bunch of boxes and you want to replace some random number of them with a sphere.

So you start out with things like this:



First select all the boxes like this:



Then run the random deselection script from here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=3927.2

Some random pieces will get deselected, looking something like this:



Run the script from before in this thread to place a point at the center of each selected object:



Now delete those selected objects:



And finally use Petr's CopyToPoints command () to duplicate the object:
http://kyticka.webzdarma.cz/3d/moi/#CopyToPoints



- Michael

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
3974.8 In reply to 3974.7 
No It's not that :)
See my previus post ;) http://moi3d.com/forum/index.php?webtag=MOI&msg=3974.6
I want replace all the blue cubes!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3974.9 In reply to 3974.6 
Hi Pilou,

> I want replace all objects with a family of other objects
> (who can be any number of objects) :)

So how about just repeat those steps above one time for each object in your family?

That should give you a mixture of replaced objects...

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3974.10 In reply to 3974.8 
Hi Pilou,

> I want replace all the blue cubes!

No problem - on the first replace just do not run the random deselection script so that you will replace all cubes on that pass.

Then repeat the steps for each additional object in the family but do the random deselection script this time.

That should result in a mixture of objects from your family of replacements, but with all original blue cubes replaced, right?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
3974.11 In reply to 3974.9 
< So how about just repeat those steps above one time for each object in your family?
Yes of course I can : it's maybe some easy for few objects in a familly but some tiedious when you have some ;)
Imagine with the 24 dices possible for a line of 100 cubes!
---
Pilou
Is beautiful that please without concept!
My Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
3974.12 In reply to 3974.10 
yes no problem with one object in the family!
That is perfect!

But very more complex when you have a big family! (24 dices)
so 24 pass !

EDITED: 13 Jan 2011 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3974.13 In reply to 3974.11 
Hi Pilou,

> Imagine with the 24 dices possible for a line of 100 cubes!

Well, that's 24 steps, but each step is happening pretty quickly.

Probably something like 10 minutes to finish?

That's not too long for some specific desired result like this...

Just make something fewer than 24 pieces to the family to make it go faster! :)

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
3974.14 In reply to 3974.13 
yes you right but it's better when computer makes that for us :)

it's possible but not very funny :)
---
Pilou
Is beautiful that please without concept!
My Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3974.15 In reply to 3974.14 
Hi Pilou,

> yes you right but it's better when computer makes that for us :)

Yes, but the computer doesn't do it on its own, someone has to program the computer to do such things...

So for example if it takes me 45 minutes to make a specialized command to make something unusual like that work faster, but it only takes you 10 minutes to actually do it in the first place, it works out better (for me anyway!) for you to do the 10 minutes part instead... ;)

If you want to do some interesting and unusual things, doing some work to produce them is just something to expect as normal.

But there are some computer-aided pieces in there to help you - things like the random deselection script, Petr's CopyToPoints command, and the script to create points at the center of each individual selected objects are each replacing a lot of manual work that you would otherwise have to do. Those should help to make it 10 minutes of work instead of many hours of work...

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
3974.16 In reply to 3974.15 
Totally right!
I have a possible solution in a reasonable time!
With the help of your script and the other from Petr!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Frenchy Pilou (PILOU)
3974.17 
---
Pilou
Is beautiful that please without concept!
My Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All