Re: [brlcad-devel] Project : Consolidate Image Processing
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: brlcad <br...@ma...> - 2012-05-30 14:16:40
|
On May 30, 2012, at 08:55 AM, Anoop Malav <ano...@gm...> wrote: Step 1. Taking various parameters from user for bolt. 1. if argc == 1 then it would ask for the options one by one. The bolt tool presently behaves this way, but is inconsistent with other tools. Running without options should result in a usage statement or generate "default" geometry. The only tools that could/should kick into interactive mode by default are the applications that support a command prompt (e.g., mged, btclsh, nirt, lgt, etc). Adding a -i option to request interactive mode would be fine (and matches at least one other src/shapes tool), and would make for a very quick/simple patch. What I'm trying to do is the following : Step 1. Breaking bolt.c in two parts - a.) src/shapes/bolt.c b.) src/libshape/bolt.c I don't think a new library for shapes would be useful right now. There are only a few shape tools and no shapes API has been defined or even scoped. It'd just be a mess of functions with arbitrary parameters. Plus, abstracting the logic out into a library would just add a layer of complexity. You'd spend hours or days moving code around while increasing maintenance cost and all without introducing anything new for users. I want to know if I'm on the right track? You could refactor the logic into src/libged as a new ged command. See src/shapes/human.c for an example. There, at least the API is well-defined and you'd introduce a new feature (a new mged/archer command). Thanks for asking and don't be shy with the questions. I suggest starting with the -i option as a patch, then migrate the functionality to libged. That should help set the stage for migrating code to libicv later. Cheers! Sean |