Design new API function to reduce duplication #2BRL-CAD
Status: ClosedTime to complete: 72 hrs Mentors: SeanTags: design, code, C, API

This task involves designing a new function that will measurably help reduce code duplication. You'll need to have already identified a piece of duplicated code that needs to be refactored and/or modified.

This task involves writing just the header file declaration and a doxygen comment that fully describes how the function behaves.  It is your responsibility to make sure that the return types and function arguments are well thought out, fit well with our existing conventions, and is a clean simple yet effective design.  Think it through.

Submit a patch file with your change, modifying the corresponding public include/header file that goes with the library being modified.

Note candidate libraries to modify are our core libraries:

  • libbu for basic utility functions
  • libbn for basic math and simple geometry functions
  • librt / libnmg / libbrep for more complicated geometry functions
  • libanalyze for analysis functions
  • libged for geometry editing (commands)
  • ... see src/README for a brief listing

 

Uploaded Work
File name/URLFile sizeDate submitted
bn_poly_header.patch1.3 KBJanuary 01 2014 19:14 UTC
Comments
Johannes Schulteon January 1 2014 17:48 UTCTask Claimed

I would like to work on this task.

Sean on January 1 2014 18:30 UTCTask Assigned

This task has been assigned to Johannes Schulte. You have 72 hours to complete this task, good luck!

Johannes Schulteon January 1 2014 19:14 UTCReady for review

The work on this task is ready to be reviewed.

Sean on January 2 2014 06:49 UTCthe name needs adjustment, but looks good

You're introducing a different naming convention, so that's the only adjustment I'd suggest.  Otherwise this looks good.


"equations" refer to a bn_poly*, suggest using "planes" instead (for which there are other examples in the API).  I suggest adjusting the function name to:


bn_polygon_mk_pts_planes()


 


It's also worth noting the relevant function bn_mkpoint_3planes() (which does have a naming inconsistency, should be bn_mk_point_3planes or bn_mk_pt_3planes), which might be helpful in the implementation.


 

Sean on January 2 2014 06:49 UTCTask Closed

Congratulations, this task has been completed successfully.