create a box on every face normal center from selected object

Hi,

i need a script that create a box, teapot whatever on every face center with normal align from selected object.

regrads,
Ulrich

AttachmentSize
facealign.png123.66 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

This can be achieved in different ways. This is one of them:

(
	objToCreate = Teapot()
 
	delSurfaceObj = false
	surfaceObj = selection[1]
	if classOf surfaceObj != Editable_Poly do
	(
		surfaceObj = convertToPoly (copy surfaceObj)	
		delSurfaceObj = true
	)
	facesCnt = polyop.getNumFaces surfaceObj	
	for f = 1 to facesCnt do
	(
		obj = instance objToCreate
		obj.pos = polyop.getSafeFaceCenter surfaceObj f
		obj.dir = polyop.getFaceNormal surfaceObj f
	)	
	delete objToCreate
	if delSurfaceObj == true do delete surfaceObj
)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.