Working at Bentley has been a great experience for me. Partly because of the great enviornment but mostly because of the problems I faced during coding one of the new features in the Microstation PlantSpace Designer Series. The problems ranged from creating quick documentation solution to document lots of vb6 codebase in python to dealing with a massive Microstation API to solving a series of problems that required inventing new data-structures, dealing with graphs and adjacency lists and developing algorithms to traverse the graph in a specific manner which wernt supported in the API. (i shall be writing about them soon).
Since i was dealing with 3d elements, handling points in 3d space was unavoidable. Engineering applications (such as the CAD/CAM category, in which PSDS lies as well) are designed to cater a divesture of standards in terms of metrics used. In the core of the software though a uniform format is used to represent values. For example a point in 3d space can be represented in many differnet formats (inches, feet, fractions etc). The format used to represent the same point in the underlying software architecture in PSDS is usually a ‘double’ (since we’re working in C – or a subset of C called MDL: microstation developer language, and yes i was creating my own adjacency lists in C and traversing them recursively). So basically the x,y and z coordinates of the point are representated as a structure of 3 doubles.
One way to compare two points (and well the most obvious way) is to calculate the distance between the two points using the distance formula. Thats all well and solved and thats not the quiz. The quiz is, given two double values, how do you compare the two to N decimal places? In other words how would you compare two points to see if they are “close enough”. (and that can be anything from being equal to 5 decimal places or being absolutely equal).
Filed under: Late Night Blog, quiz, late night bloggin', programming, quiz
Talk Back!