MoveObjectParallelFaces, AlignFaces, RotateGroupCentre, Move

zip / doc updated. See comments above and on top message.

2009/03/20 :
1) Scripts adapted and expanded for 3DC 7.2
2) New script : FlattenFace
3) While testing MovePointOnPlane and MoveObjectParallelFaces for 3DC 7.2, the 7.1 versions were re-written (documentation and zip updated)


2009-03-06 update:
1) Updated MovePointOnPlane
2) New zip of files provided (see down the topic)
3) Link to documentation (see down the topic)
3) Next step: test the 7.2 versions of the scripts


The coming 3DC 7.2 allows for multiple selections among different objects.
Often there is a need to align faces of 2 objects.

I wrote MoveObjectParallelFaces for 3DC 7.1, so faces of only one object can be selected. I’ll convert and adapt the script when 3DC 7.2 is released.

Here are examples of what can be done (the first one was the starting point of my decision to write a script).
Let’s say I have a cab console and I want to add a CRT monitor (images from a stripped down version of a 3D cab currently being built; it is a simulation due to current 7.1 limitations):
[img:33geauuz]http://img8.imageshack.us/img8/5070/3dccab01.jpg[/img:33geauuz]

I select the front face of the CTR monitor, the targeted face on the cab console, enter a shift value of 2cm and apply MoveObjectParallelFaces. The CRT console is moved to the center of the selected can console face:
[img:33geauuz]http://img408.imageshack.us/img408/9040/3dccab02.jpg[/img:33geauuz]

Now, after clicking on the object coordinates icon, I just need to move the monitor in the yz plane to the right location:
[img:33geauuz]http://img242.imageshack.us/img242/9172/3dccab03.jpg[/img:33geauuz]

If no shift is entered, the object is just rotated in place (example using 3DC 7.1):
[img:33geauuz]http://img9.imageshack.us/my.php?image=image14u.jpg[/img:33geauuz]
[img:33geauuz]http://img9.imageshack.us/img9/1349/image14u.th.jpg[/img:33geauuz]

[b:u5s046di]MoveObjectParallelFaces[/b:u5s046di]

I updated the script to deal with the selected groups and the children.
It works OK:
[img:u5s046di]http://img19.imageshack.us/img19/5508/image15.jpg[/img:u5s046di]

[b:19l0ws1l]AlignFaces[/b:19l0ws1l]

New script (again, it will be more useful with 3DC7.2 multiple object selection):
Align the center of a first selected face to the center of a second face along the second face normal.
If the faces are parallel, both faces will be in the same plane.

[b:1f3gnij5]RotateGroupCentre[/b:1f3gnij5]
Rotate a group axis system so that one axis is in the same direction or in the opposite direction of a selected face normal or the bisector of the 2 faces normal.

Examples of use:
– A door is tilted (faces not parallel to world axis sytem) and ‘normalize groups’ was applied.
I apply the script to have faces parallel to the object axis system
Now I can easily scale the object along one axis.
[img:1f3gnij5]http://img15.imageshack.us/img15/2212/image1ojf.jpg[/img:1f3gnij5]

– The object was created with an axis system which orientation is not correct.
Select 2 faces from an object which bisector is pointing in the same direction as the desired X axis direction.

[img:1f3gnij5]http://img7.imageshack.us/img7/8762/image2e.jpg[/img:1f3gnij5]

Thanks for these Dom – looking forward to seeing more <!– s:) –><img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" /><!– s:) –>

One suggestion to help other users – you could zip the .cs file and add it as an attachment to the forum post.

[b:1tjgqspd]MovePointOnPlane[/b:1tjgqspd]

Point 1 is not correct. The shape is distorted.
I put point 1 in the same plane as points 2 to 4 using the same Y as point2.

[img:1tjgqspd]http&#58;//img16&#46;imageshack&#46;us/img16/7219/image3ltq&#46;jpg[/img:1tjgqspd]

2009/03/06 update: There is one more step in the process in order to select the reference point.

Zipped script files: see link below.

[img:k7fi4am6]http&#58;//www&#46;wikiupload&#46;com/download_page&#46;php?id=108275[/img:k7fi4am6]
Link to updated documentation – 2009/03/20
.

7.1 Scripts updated (MovePointOnPlane and MoveObjectParallelFaces) and new script FlattenFace.

New script : [b:2s3otrt0]FlattenFace[/b:2s3otrt0] (Flatten a face so that all points have the same X, Y or Z)

[img]http://img24.imageshack.us/img24/2737/3dcflattenface01.jpg’]

[b:6fu67eyn]MovePointOnPlane[/b:6fu67eyn] with 3DC 7.2 alpha4

[img:6fu67eyn]http&#58;//img12&#46;imageshack&#46;us/img12/8920/3dcmovepoint01&#46;jpg[/img:6fu67eyn]

[img:6fu67eyn]http&#58;//img12&#46;imageshack&#46;us/img12/3672/3dcmovepoint02&#46;jpg[/img:6fu67eyn]

[b:2c5qfjg9]MoveObjectParallelFaces[/b:2c5qfjg9] with 3DC 7.2 alpha4

[img:2c5qfjg9]http&#58;//img23&#46;imageshack&#46;us/img23/7042/3dcmoveparallel&#46;jpg[/img:2c5qfjg9]

You must be logged in to reply in this thread.