Wednesday, March 17, 2010

Offset merging

Ported a first version of Offset to meta tools so that it integrates with command line.
Not finished porting because encountered some issues at the existing offset tools.

Currently Naro has an Offset 2D tool used to offset wires (a connection of more than one segment, it doesn't work for a simple line) the result is a shape drawn around the original wire and a 3D offset tool using the 3D offsetting algorithm from OpenCascade for solids that gives some strange results.

The plan before finishing the port to command line is to merge all offsetting tools under one tool that detects the particular case and applies the appropriate offset algorithm. The functionality will be slightly changed as follows:
- if offset is applied for one line it will duplicate the line at the offset distance that will be useful for building helper drawing lines - the mouse location will be used to detect the offsetting direction,
- if the offset is applied on a wire built from more than one segment the offset will duplicate the wire at the offset distance - not sure that this will be implemented,
- if offset will be applied on a face like for example a rectangle, an offset algorithm will be applied and the result will be a smaller/bigger rectangle not a translated rectangle like in the case of a line,
- if offset will be applied on a solid will see if some good and quick results can be obtained with the OpenCascade algorithm. Will analyze here if offset on solids is used in industry and remove the functionality if it is not useful.

Will think for a consistent solution for all these situations (for lines the result is a translation for faces and solids it is an offset shape).

Applying Offset on a wire made from more than one line, lines selected with shift+click, generates another problem: it is quite difficult to know when the users finished selecting and started offsetting.

No comments: