Closed timmercy closed 8 years ago
Or the user defines a (set of) characteristic dimension. See for example quadrotor: you specify a 'radius'. This determines the collision-avoidance circle and the drawing. Maybe just define the length?
Defining the length is a good idea maybe.
Or: I already added the option 'plot_type': 'car' or 'bicycle' --> so the user can choose to plot one or two wheels. So another option is to also add a 'plot_shape' --> rectangle, while Bicycle.shapes = Circle?
What do you prefer?
Your option is maybe more elegant, the other one leaves more freedom to the user...
But how are you using the plot_shape? Your plot shape is in fact a bicycle (or car): a frame with 2 wheels. You only define the frame with this rectangle. It is not useful to supply this rectangle as frame.
We should limit ourselves in the possible drawings: user can choose between car of bicycle. He also provide a dimension. Based on this dimension, the anti-collision shape is determined (preferable circle). And also based on this dimension the exact drawing is dimensions: ie. your bicycle/car (both frame as wheels) should scale with this dimension.
See implementation of draw() in Quadrotor for an example.
On 20-04-16 18:15, timmercy wrote:
ls. So another option is to also add a 'plot_shape' --> rectangle, while Bicycle.shapes = Circle?
It is much easier to impose the anti-collision constraints for a circular shape. So the user can define a Bicycle to have a circular shape, but still a rectangle can be plotted (which is a more realistic shape for a bicycle).
I don't know what's the best solution here:
Option 1 seems the most logical, but maybe it is strange for the user to define a circle and see a rectangle? While if you force him to define two shapes it is not.