def updateGeometryFromProperties(self): d = DebugData() length = self.getProperty("Length") d.addCapsule( center=(0, 0, 0), axis=(0, 0, 1), length=self.getProperty("Length"), radius=self.getProperty("Radius"), ) self.setPolyData(d.getPolyData())
def updateGeometryFromProperties(self): radius = self.getProperty("Radius") circlePoints = np.linspace(0, 2 * np.pi, self.getProperty("Segments") + 1) spokes = [(0.0, np.sin(x), np.cos(x)) for x in circlePoints] spokes = [radius * np.array(x) / np.linalg.norm(x) for x in spokes] d = DebugData() for a, b in zip(spokes, spokes[1:]): d.addCapsule( center=(a + b) / 2.0, axis=(b - a), length=np.linalg.norm(b - a), radius=self.getProperty("Tube Radius"), ) self.setPolyData(d.getPolyData())