View Single Post
  #7  
Old 08-04-2015, 04:23 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
As a workaround, would the following work for you? This sets a group node to be the sensor's source object. The red cylinder is linked to the group node and scaling the cylinder does not affect the area shape:

Code:
import viz
import vizshape
import vizproximity

viz.setMultiSample(4)
viz.fov(60)
viz.go()

import vizcam
cam = vizcam.PivotNavigate(center=[1,0,0],distance=5)
cam.rotateUp(30)

manager = vizproximity.Manager()
#to see the circleArea
manager.setDebug(viz.ON)

redCylinder = vizshape.addCylinder(height=2.0,radius=0.3,topRadius=None,bottomRadius=None,yAlign=vizshape.ALIGN_MIN,slices=20,bottom=True,top=True)
redCylinder.color(viz.RED)

group = viz.addGroup(pos=[1,0,0])
viz.link(group,redCylinder)

#scale the second red cylinder up
redCylinder.setScale(2,2,2)
redSensor = vizproximity.CircleArea(radius=0.7)

#link sensor to the object
linkedRedSensor = vizproximity.Sensor(redSensor, group)
manager.addSensor(linkedRedSensor)
Reply With Quote