3-point* Mirror

Could anybody write the subject please?
Something like Autocad's Mirror3d (Sketchup has similar plugin too)
*3 mouse clicks would define a mirror plane

Thanks in advance

Comments

Comment viewing options

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

Miauu, could you please add

Miauu, could you please add 'keep original' option?
and there's a bug: oddly the script mirrors ALL instances (not only the ones are preselected)

1rv's picture

Thank you Miauu! Please check

Thank you Miauu! Please check PM.

jahman's picture

_

(
tool pick3points (
 
	local p1,p2,p3
 
	on mousePoint clickno do (
 
		case clickno of (
 
			1: p1 = worldpoint
			3: p2 = worldPoint			
			4: (
 
				p3 = worldPoint	
				stopTool pick3points
				#( p1, p2, p3 )
 
			)
			default:()			
 
		)
 
	)
 
	on mouseMove clickno do redrawViews()
 
	on mouseAbort val do (
 
		stopTool pick3points
		undefined
	)
 
)
 
if selection.count > 0 do (
 
	pts = starttool pick3points
 
	if pts != undefined do (
 
		norm = normalize (cross (pts[2] - pts[1]) (pts[3] - pts[1]))
 
		center = (pts[1] + pts[2] + pts[3]) / 3.0
 
		for s in selection do (
 
			try (
 
			addModifier s (m = mirror()) 
 
			m.mirror_axis = 2
			m.Mirror_Center.rotation = inverse (MatrixFromNormal norm).rotation
			m.Mirror_Center.scale = [1,1,1]
			m.Mirror_Center.position = (center - s.pos)
 
			)catch()
		)
 
	)
)
)
miauu's picture

Comment viewing options

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