wbt
New Member
Posts: 4
|
Post by wbt on Feb 23, 2018 10:50:36 GMT
Hi Jacques, I have built a visualisation of a car with turning wheels. This used to work with a previous version of SimPyLC, but with the latest version it generates the error File "H:\Mijn Documenten\TINRES\simulations\test\visualisation.py", line 9, in <lambda> return Cylinder.__call__(self, shift = shift, rotation = rotation, parts = lambda: self.spoke() + self.spoke(rotation = 90)) File "C:\Python36\lib\site-packages\SimPyLC\scene.py", line 217, in __call__ if self.scene._displayMode == Scene._dmCheck: AttributeError: 'Beam' object has no attribute 'scene'
What I do is define my own class Wheel, of which I use four instances: class Wheel (Cylinder): def __init__(self, center = (0, 0, 0)): Cylinder.__init__ (self, size = (1, 1, 0.2), center = center, color = (0, 1, 0), axis = (0, 1, 0), angle = 90, pivot = (1, 0, 0)) self.spoke = Beam(size = (0.3, 0.1, 0.9), color = (0, 1, 0), pivot = (1, 0, 0))
def __call__(self, shift = (0, 0, 0), rotation = 0): return Cylinder.__call__(self, shift = shift, rotation = rotation, parts = lambda: self.spoke() + self.spoke(rotation = 90))
The spokes of the wheel are beams, but this now no longer works. Is this a bug or did I make a mistake? Please find a complete example of the problem here: med.hr.nl/berwm/demo.zipThanks for your reply, Wouter
|
|
|
Post by Admin on Mar 1, 2018 12:59:52 GMT
Hi Wouter
This bug has been fixed. It was introduced in making the rocket demo fly... Your demo works now, at least on my Windows 10 machine.
Kind regards Jacques
|
|