The new Transformation implementation

Currently, point coordinates and sketch axis location and direction are absolute – this means that there is no relation between a sketch axis and the points it contains or between the base sketch used for extrude and the sketches created on the extruded solid’s faces. This creates problems when we try to perform transformations on the sketches because the relative positions can’t be maintained.

For example, if we draw a circle on the face of a cube and then rotate the cube, the new position for the circle’s center won’t have the same distance from the face’s edges because the pivot used for the rotation is not relative to the sketch.

The new implementation uses the Transformation interpreter to store information about the relative position of a sketch and point. All sketches will have a transformation: if the sketch is independent (created on the default plane or from the command line) their transformation will be relative to the default axis which is in (0; 0; 0) and has a direction of (0; 0; 1). If the sketch is created on a solid’s face, it will be relative to the base sketch, with a translation and rotation component.

Point transformations will be relative to their sketch’s axis location and will have a translation component. The final point position in 3D space will be obtained by applying both the point’s translation and the sketch’s transformation – this succession of transformations can be applied recursively no matter how many ‘levels’ of sketches we have.

I have started implementing this yesterday and so far the sketch axis transformation is set when the sketch is created, the point transformation is created when the point is added to the scene and the two transformations are used to obtain the final position for the point, but there are some problems with the point translation being applied twice in some cases.

  0 COMMENTS
Status report

Leave a Reply

Pages
Blogroll





The best Android Market
AndroidPit