Automated 3D solid reconstruction from 2D CAD using OpenCV
AAutomated 3D solid reconstruction from 2D CAD using OpenCV
Ajay B. Harish a, ∗ , Abhishek R Prasad b a Dept. of Civil and Environmental Engineering, University of California, Berkeley, CA, USA b Dept. of Computer Science, Indian Institute of Technology, Dharwad, India
Abstract
This work demonstrates the application of OpenCV towards feature extraction from 2D engineering drawings. Theextracted features are used in the reconstruction of 3D CAD models in SCAD format and generation of 3D pointcloud data that is equivalent to LIDAR scan data. Several legacy designs in mechanical and aerospace engineeringare available as engineering drawings rather than software generated CAD models. Even in civil engineering, manyof the earlier plans are available as drawings rather than BIM / CAD models. The methods proposed in this work canhelp convert such drawings easily into 3D CAD and BIM models using camera capture or scanned drawing data. Themethod demonstrates the applicability for simple shapes and does not yet account for the presence of hidden lines inCAD drawings. The developed codes are made available as python Jupyter notebooks through Github.
Keywords:
OpenCV, 2D to 3D reconstruction, SCAD models, 3D point clouds, Jupyter notebook
1. Introduction
Over the last decade, the growth of 3D modeling software has helped rapid 3D prototyping using Computer-AidedDesign (CAD). One of the common ways to represent geometries in engineering is 2-D Computer Aided Drawing(CAD) drawings and 3-D solid models. There are several commonly used formats that include both, open-source like step, iges and proprietary like sldprt etc. Over the years, several interpreters have been developed to convertbetween formats and have been optimized for minimal data loss during the conversion process. However, this rapidtransition into the digital era meant a transition from paper drawings to computer models.Even today, several legacy drawings and designs that were not originally developed using software but as 2D drawingsexist. Thus, there is a need to develop algorithms that can render these 2D engineering drawings into a solid thatcan be used for manufacturing. The topic itself is not new but dealt with as early as the ’80s. Aldefeld [1], Preiss[14], Chen and Perng [3], Nagendra and Gujar [13], Kargas et al. [8], Gujar and Nagendra [7], Liu et al. [10] discussedusing views (front, top, side, orthographic) in an engineering drawing to convert to 3D CAD geometries. This hasbeen one of the prevalent technique in the early stages. Many of these studies were initially motivated to build betterintegration and interfaces between the CAD design and manufacturing process. There are several ways that the taskcan be accomplished. The most primitive and simplest approach is to use geometric entities like points, edges andfaces to convert them into equivalent 3D components. While such an approach is easier to implement, such extractiontechniques cannot represent all forms of geometries. In general, the methods proposed to date can be broadly classifiedinto (a) pattern recognition, (b) state transition, (c) decomposition (d) graph-based approaches.Lequette [9] presented an algorithm that uses the geometric primitives to construct solids where the surfaces’ axes areparallel with the projection axes. The intersection curves are straight lines or circles. Madurai and Lin [11] proposed aset of rules to identify geometric entities from CAD files to help integrate CAD / CAPP and manufacturing semantics. ∗ Corresponding author at: Dept. Civil and Environmental Engineering, University of California, Berkeley, CA, USA
Email addresses: [email protected] (Ajay B. Harish ), [email protected] (Abhishek R Prasad)
Preprint submitted to Computer-Aided Design January 13, 2021 a r X i v : . [ c s . C G ] J a n long similar lines, Meeran and Pratt [12] discuss the idea of feature extraction from 2D drawings to create 3D CADmodels automatically. In this process, they employ DXF files to read the 2D drawing data. The viability of the systemhas been demonstrated for simple geometries. An alternative to the three-view approach, Geng et al. [5] proposed ahuman-like multi-view reconstruction approach where the overall geometry is partitioned into sub-spaces (like holes,plates, etc.), and each of these sub-spaces is individually transformed to convert the complete model. Cayiroglu [2]proposed a feature extraction techniques based on a three-space method. Here, three surfaces are used, namely base,top, and sweep, to extract the object’s overall shape. The base provides a projection of all the features on to a bottomsurface. The others are used to determine the rest of the features.The implication of the 2D drawing to 3D CAD is not limited to mechanical engineering and manufacturing. Gimenezet al. [6] explores the potential of automated reconstruction of 3D BIM and CAD models from 2D scanned buildingplans. While new drawings and designs are developed using software platforms, this is not true for many renovationmodels. Many building renovations have the original and legacy data available as 2D drawings. Manual conversion ofsuch designs can be cumbersome and can use the latest technologies available.A more detailed discussion and literature review about the recent developments can be found in the work of Shi et al.[16]. While the topic is not new but certainly remains topical considering the growth in computer graphics and machinelearning that can be applied to core engineering domains. OpenCV is widely used in a variety of applications likeself-driving cars to identify complex geometries.This work aims to use the developments in computer graphics and vision and demonstrate their applicability to theconversion of 2D engineering drawings to 3D CAD modeling. Here, the engineering views are used to reconstructthe images. At present, the hidden lines are not considered but can be easily added and extended into the developedinterface. The developed method is applicable for DXF drawings or drawings in PDF and those that can be obtainedfrom other sources like a camera. This flexibility to re-created solid objects from the images obtained, from a camera,of the top-side-front view, renders the method versatile to 3D CAD reconstruction of a wide variety of objects. Atpresent, the limitation of the proposed method is using the SCAD format since it facilitates Boolean operations. SCADtools allow conversion of SCAD models to other formats like STEP, IGES, etc.A python Jupyter-notebook based interface is used to extract and convert 2D CAD drawings (either obtained as PDF / DXF files / photos) into 3D solid models, in SCAD format, in real-time. Further on, the developed SCAD modelsare automatically converted to 3D point clouds. These 3D point clouds can be easily converted into 3D meshing forFEA analysis or manufacturing semantics. The developed methodologies are shared as open-source Jupyter notebooksthrough Github. The next section presents detailed theoretical and algorithmic implementations, followed by briefresults and conclusions.
2. Theoretical formulations
As discussed in the previous section, there is extensive literature on automated feature extraction ideas from 2Dengineering drawings to create 3D CAD models. However, the uniqueness of this work rests in the usage of moderntechnologies like OpenCV. There are multiple steps involved in feature identification, recognition, and conversion into3D SCAD solids. The initial starting point can be assumed to a scanned copy of the 2D drawing or a photo of thedrawing. The most important theoretical ideas are outlined in this section. The overall flow is given in the Fig. 1. Theprimary steps involved in the re-construction process involves detection of the outer boundaries and development of abounding box; determination of point location with reference to the bounding box; final conversion of all points ofinterest into a 3D CAD model in SCAD format. In this section, starting with the basic theoretical ideas, the algorithmicimplementation as well is discussed.
In this regard, the first step involves converting the image into a form where the features can be identified. While edges and contours are often used interchangeably in normal literature, they mean di ff erent thing in computer graphics.Edges are points whose values change significantly compared to their neighboring points. Thus, the concept of edgeslies in a local range. In contrast, contours are closed curves that are obtained from edges and depicting a boundary of2igure 1: Flowchart describing the conversion of 2D view to 3D CAD modelfigures. A contour line indicates a curved line representing the boundary of the same values or the same intensities.Thus, a contour line is at the overall boundary of a figure. The contour calculated using OpenCV is a list of pointsconsisting of the contour lines, and it is necessary to sort the contours by their area to draw the outer line of the 2Ddrawing. Thus, this starts with gray-scaling the image and re-arranging the contours. i m g r e y = cv2 . c v t C o l o r ( img . copy ( ) , cv2 . COLOR BGR2GRAY) r e t , t h r e s h = cv2 . t h r e s h o l d ( imgrey , 1 2 7 , 2 5 5 , cv2 . THRESH BINARY INV ) c o n t o u r s , h i e r a r c h y = cv2 . f i n d C o n t o u r s ( t h r e s h , cv2 . RETR CCOMP ,cv2 . CHAIN APPROX SIMPLE ) h i e r a r c h y , c o n t o u r s = z i p ( * s o r t e d ( z i p ( h i e r a r c h y [ 0 ] , c o n t o u r s ) ,key = lambda x : cv2 . c o n t o u r A r e a ( x [ 1 ] ) , r e v e r s e = T r u e ) )In order to extract features from the image, a bounding box is required. It is, thus, necessary to determine the centerand extremum points of the contour. Once the image is grey-scaled and the contours have been extracted, the OpenCVfunction cv2.moments() can be used to extract a dictionary of all moment values calculated for the contour. Inmechanics, the moment represents the product of force and distance. Alternatively, in computer vision, this representsthe centroid of an image and represented by a weighted average of image pixel intensities and can be written ass M pq = (cid:90) ∞−∞ (cid:90) ∞−∞ x p y q f ( x , y ) dxdy (1)for p , q = , , , ... . This can be further adapted for the grey-scaled image with pixel intensities I ( x , y ) to determine theraw image moments M i j as M i j = (cid:88) x (cid:88) y x i y j I ( x , y ) (2)The centroid of this image is given as C x = M M and C y = M M (3)3 E v a l u a t e t h e c e n t e r o f t h e c o n t o u r cX = i n t (M[ ”m10” ] / M[ ”m00” ] )cY = i n t (M[ ”m01” ] / M[ ”m00” ] )One of the last steps in determining the ends of the figure includes the evaluation of a bounding box. As shown inFig. 2, the object of interest can be rotated. Thus, it would be necessary to consider both the extremum points and theFigure 2: Green rectangle shows the normal bounding rectangle while red rectangle shows the rotated bounding boxthat is an accurate fit.object’s rotation to evaluate the minimum area of the bounding rectangle. The area of the straight rectangle is not theminimum. x , y , w, h = cv2 . b o u n d i n g R e c t ( c n t ) r e c t = cv2 . m i n A r e a R e c t ( c ) Given any point, it is necessary to determine with the point lies inside or outside a particular contour. A signed distancefunction can be used to determine a point’s location in relation to the contour. Such a function return + / -1 / / outside / on the contour respectively.d i s t = cv2 . p o i n t P o l y g o n T e s t ( c n t , ( 5 0 , 5 0 ) , T r u e ) The last step involved involves the recognition of 2D shapes that need to be converted into 3D solids. In this work,six shapes are considered: triangle, square, rectangle, pentagon, hexagon, and circle. The Ramer–Douglas–Peuckeralgorithm [15, 4] is employed to convert the curve into a set of points. d e f d e t e c t ( c ) : s h a p e = ” u n i d e n t i f i e d ”p e r i = cv2 . a r c L e n g t h ( c , T r u e ) a p p r o x = cv2 . a p pr o x P o l yD P ( c , 0 . 0 1 5 * p e r i , T r u e ) c y l i n d e r t y p e = i f l e n ( a p p r o x ) == = ” t r i a n g l e ”c y l i n d e r t y p e = e l i f l e n ( a p p r o x ) == ( x , y , w, h ) = cv2 . b o u n d i n g R e c t ( a p p r o x )a r = w / f l o a t ( h )r e c t = cv2 . m i n A r e a R e c t ( c )a r = r e c t [ 1 ] [ 0 ] / f l o a t ( r e c t [ 1 ] [ 1 ] ) s h a p e = ” s q u a r e ” i f a r > = and a r < = e l s e ” r e c t a n g l e ” e l i f l e n ( a p p r o x ) == = ” p e n t a g o n ”c y l i n d e r t y p e = e l i f l e n ( a p p r o x ) == = ” h e x a g o n ”c y l i n d e r t y p e = e l s e :s h a p e = ” c i r c l e ”c y l i n d e r t y p e = r e t u r n s h a p e , c y l i n d e r t y p eFinally, the evaluated shapes are converted to 3D solid in the SCAD format using the basic shapes given as • sphere(r = radius) • cube(size = [x,y,z], center = true / false), where the center lies at (0,0) • cylinder(h,r1,r2,center,fn : fixed number of fragments)followed by boolean operations, namely union() and difference() , that lead to complex shapes and objects. Asample of such union is shown in Fig. 3.u n i o n ( ) { c y l i n d e r ( h = = = t r u e , $ f n = = = = t r u e , $ f n = } The actual algorithmic implementation involved in converting the 2D drawing to a 3D SCAD model involves multiplesteps, and the most important steps are discussed below. The steps involved include: dimensioning, identification ofshapes in each view, determination of the translation and rotations of objects in each view, combine parts from allviews, create a tree for the SCAD file, create a 3D point cloud.5igure 3: Union of two cylindersFigure 4: Dimensioning: Requesting length of the rectangle
The user-provided image is used in the determination of the pixel densities and object length. Thus, if the imagescontaining the di ff erent views are of di ff erent pixel densities, it is impossible to determine the actual dimensions of theshape. Thus, as shown in Fig. 4, the user also defines the dimension of the highlighted line of the object, which is usedto determine the object length to pixel ratio. The overall process of determination of the outermost contour is as shownin Algorithm 3. Algorithm 1:
Dimensioning
Result:
Gives the unit length per pixel ratio and the highlighted contour image
Data:
Give an image /* Find the all the closed contours using OpenCV by following theoretical formulation*/ return the outermost closed contour highlighted in the image and the value of the inverse the length of theminimum rectangle enclosing that contour found using theoretical formulation2.4.2. Linked parent-child lists
The overall shape details are decoupled and stored in a linked list as • node object - Class object containing details of a shape for constructing 3D model for that shape • tuple([cX,cY]) - center of contour • contour from image processing / index of the parent-child • height of the horizontal rectangle enclosing the contour(h) • width of the horizontal rectangle enclosing the contour(w)As shown in Fig. 4, the views likely have one object inside another, here a circle and rectangle inside a bigger rectangle.Thus, a parent-child relation grouping is necessary through a shape list. Each shape list in each view can be organized6s follows: ob jects = [ { parent , child , child .. } , { parent , child , child .. } , .... ] (4)where the objects is a list of list with each list outlining the parent followed with child details. Each parent and childhas all the details of the shape list that is provided above that are only visible to that particular view. For example, inFigure 5: Front view of a modelFig. 5, the rectangle is a parent of the circle and thus, the list of objects in the front view will contain ob ject f ront = [ rectangle detail list , Circle detail list ]Since these parent-child lists are limited to a particular view, they do not provide a complete perspective of the 3Dshape. For example, the front view consists of information about the height and the length but does not provide anyinformation about the object’s breadth. This is available in the side view. Thus, once all the views have been parsed, afinal parent-child list containing all details of the 3D shape can be created.
Before the SCAD file’s consolidation and generation, it is necessary to re-arrange the output parent-child lists fromeach view. The front view list is stored in a descending order of the x − coordinate of the parent’s center obtained fromimage processing. The other two views are stored in ascending order. For example, if the center coordinates of the parent are (6,5) and that of parent are (3,8), then the object lists created as shown in Eq. 5. ob ject f ront = [[ parent , child , child .. ] , [ parent , child , child .. ]] (5)The entire process is outlined in Algorithm below.Algorithm 3 further describes the process of creating the parent-child lists for a particular view. Firstly all the contoursrecognized are arranged in the descending order of the area occupied by the contour. Further on, looping through eachcontour, one can determine the shape of the contour, i.e., determine the rectangle’s length and height, the radius ofcircles, etc. Additionally, the center of the largest contour is also considered to calculate the child object’s translationand rotations in relation to the parent object. Based on the recognized shape, a node class object is defined as a cube forsquare and rectangle, and cylinder for triangle, pentagon, hexagon, and circle.Regarding the images considered for image processing, the below convention is considered • The front view is pointed along the y -direction. The translation in z and x -axis and rotation about the y -axis areobtained by image processing. • The side view is towards -x direction. Since one is viewing from the y -axis for image processing, all the shapesrecognized from the side-view are rotated by 90 ◦ about the z -axis. Viewing the shapes from the x -axis, therotations about x -axis and translation along y - and z - axis are also obtained. • The top view is oriented towards the z -axis. Here the rotations about z -axis and translations about x - and y -axisare extracted. 7 lgorithm 2: Identifying the shapes in each view and create a 3D model for the same
Result:
Gives a final 3D scad file
Data:
Give one image for each view, namely front, side, top, along with the length to pixel ratio /* front */ object front = valid contours (img front,”front”,fratio); // Follow algorithm// We re-arrange the parent-child lists, for front view store all the parent-childlists such that the center of the parent shape in a parent-child list is arrangedin descending order of x pixel of the center of the parent shape from imageprocessing, otherwise do ascending order in side and top view re arrange (object front,”front”); /* side */ object side = valid contours (img side,”side”,sratio); re arrange (object side,”side”); /* Top */ object top = valid contours (img top,”top”,tratio); re arrange (object top,”top”); /* Thershold error, minimum error allowed to check for equality */ minApprox = = combining (object front,object side,object top,minApprox) ; // Follow algorithm final = []; for set in primitive dofor shape in set do final.append(shape[0]); /* Creates final scad file */ createtree (final) ; // Follow algorithm Once the list of parent-child objects has been assimilated from all the views, it is essential to separate the duplicatesbefore combining them into a single shape. Here, the front view is considered a primary list, and the shapes from otherviews are added and updated using the Algorithm 4 described below.In order to assimilate the views and convert them to a 3D CAD model, di ff erent cases are considered. For eachparent-child object list available in the front view, their counterpart with the same shape is searched in the side view.This is achieved by comparing the height of the shape stored in the shape detail list. In order to allow for variations, asmall error, called roundOffApprox is allowed. If the shape of interest is present in the side view but is not a parent,then the shape is being extruded. Thus, a union operation is associated with this shape. Alternatively, if a counterpartexists in the side view, then the rest of the shape in the list are added as holes on the parent. This is always the casesince the parent-child lists are already re-arranged in the descending order of the center x - coordinate of the parents.Thus, this automatically allows one to consider all the shapes that require an extrusion at the first pass. If the front viewhas a cylinder, then the missing dimensions are updated from the side view. Alternatively, if the front view has the formof a cube, then two possibilities need to be considered in the side view, namely: • Cube:
The search continues in the top view where there are two possibilities that the shape is a cylinder or acube. In the former case, the front shape is replaced with a cylinder with proper translation and all the missingdimensions and index in the parent-child list is stored as a part of the top view shape details. In the latter case, thefront shape is replaced by a cube along with any rotation about the z − and / or x − axis. In all the cases, relevantmissing dimensions are updated. • Cylinder:
If this is a cylinder, then the front view cube is replaced by side view cylinder with proper height andtranslation 8 lgorithm 3:
Identify the 2d shapes in each view, and gather dimensions, translation and rotation
Result:
Gives the list of a list of parent child shapes
Data:
Give a image for a view along with length to pixel ratio
Function valid contours( image, view, ratio ) : Find valid contours for front view and arrange it in a descending order of area occupied by each contour, followtheoretical formulation;objects = [] ; // To store the parent and it’s children shape for each episode contour doif Choosing only the inner side of the two same shape / contour created by the thickness of the line then shape, cylinder type = Detect shape of contour ; // whether it is triangle or cube orrectangle or pentagon or hexagon or circle or even unidentified rect = cv2.minAreaRect(c); // Follow theoretical formulation/* Rescaling based on input from user */ rectLength = rect[1][0] * ratio;rectBreadth = rect[1][1] * ratio; if len(objects) == then pos = [cX,cY] ; // To find center follow theoretical formulation part = [] ; // To store all the information regarding one shape/* We can also find the rotation(r) of the cube or rectangle with the help ofOpenCV refer theoretical formulation */ if shape is square or rectangle then /* Add the required elements to part variable as given in section */ else /* Add the required elements to part variable as given in section */ However, for the shapes not visible in the front view but visible in the side view similar iteration over the parent-childlist of the side view is considered. If the shape is not already considered in the earlier iterations, the search for itscounterpart in the top view is initiated. Similar iteration between the side and top views are considered to determine allthe objects outlined in the side view.Finally, if the shape is only visible in the top view, this is likely a hole visible only in the top view. This also means thatthe hole’s parent should be at least visible in the front or side view. Else, that shape can be ignored. If the parent wasvisible, then the parent-child index will tell us where to add these holes in the parent-child list. (a) Bottom cube parent visible in front view (b) Top cube parent visible in front view
Figure 6: Binary tree created to produce the scad fileOnce the final parent-child lists have been set up, they are compressed into a single list. The Boolean operation forthe parent objects will be
Null while that of the children objects are either
Union or Difference . This final list’s9 lgorithm 4:
Combining the parts from all View
Result:
Gives the final list of shapes with parent child relation to form the 3D model
Data:
Give all the parent child list for all views, namely front, side, top and minimum error allowed
Function combining( front parts, side parts, top parts,roundO ff Approx ) : /* Note each shape has a list of details refer */ for loop through front parts as front do first = for loop through all the Shapes in the list as part f do /* Length of the part is 5, if it is greater than 5, then that shape isalready considered */ if len(part f) > = then continue if first == then /* Give the width/height of the parent to the child according to shape,height for cylinder and breadth for cube types when the parent’swidth/height found from side view */ found = // For checking whether the front shape is visible in side for loop through side parts as side // Search side view do /* For adding rest of the shapes in side view list, once a shape is foundin the side view */ add rest = for loop through all the Shapes in the list as part s doif add rest == then /* Add inner parts of side view only visible from side view andmaking sure the same shape is not added again once the shape isavailable in side view *//* check whether the height in front view is same in side view */ if height in front view and side view are approximately same then /* If the shape in front and side is cube check top view, forrotation of the cube along z axis, or it can be a cylinder typeshape *//* If the shape in front view is already found, don’t check any othershapes in the next parent child list */ if found == then break; if found == then /* If the corresponding shape of the front view is not found in side viewcheck in top view to get the thickness of the shape */ for loop through side parts as side do /* Add the shape that is only visible in side view and top view(parent part andits child) */ for loop through top parts as top do /* Add shapes only visible in top */ return front parts (a) Front View (b) Side View (c) Top View (d) Final 3D Model Figure 7: Simple example demonstrating the di ff erent views and the final SCAD model generated from these views
3. Results and discussions
The developed model can recognize several 2D shapes, including triangle, square, rectangle, pentagon, and hexagon.However, 3D models with objects rotated about multiple axes are not supported. Additionally, the translationsconsidered are relative to the outermost contour in each view. Thus, the outermost contour in each view needs torepresent the same 2D shape. In order to demonstrate the applicability of the developed method, simple geometries ofinterest are considered and shown in Table. 1. In Table. 1, the primary dimensions of the outermost contour, extractedfrom each view, is marked and shown in green. The table also shows the final SCAD model created and the processingtime. As evident, the total processing time is of the order of milliseconds and is time-e ffi cient.The shapes demonstrated here are simple but the developed methodology using OpenCV is generic and can be extendedfor more complicated shapes and models. While SCAD models are useful, they do not find industry applications yet. However, SCAD already provides toolsrequired to convert the models to more industry suitable formats like
STEP and IGES and so on. Further on, it is moreuseful to convert these SCAD models to 3D point clouds that can be used for automatically generating high-qualitymeshes for numerical simulations like finite element analysis. In this regard, the generated SCAD file is first convertedto
STL format. The open3d method proposed by Yuksel [17] and implemented in the
Open3d library is directlyincorporated to determine the points and generate a 3D point cloud. Table. 2 shows the point clouds generated for theobjects shown in the example earlier.
4. Conclusions and Future Work
While the topic of automatically converting 2D engineering drawings to 3D CAD models is not new, the topic remainstopical. This work leverages the latest developments in computer vision to develop an algorithm for automatedconversion. In this regard, SCAD geometries are generated from 2D geometries. The entire methodology is developedas a python Jupyter-notebook that can be easily accessed and run locally.The geometries considered in this work are still simple, and there exists a need to add more shape recognition ability tothe developed methodology. Such shape recognition can be easily achieved today using Neural Networks and integratedinto the Python Jupyter-notebook outlined here. While the current work does not completely solve the problem of 2Dto 3D automated conversion, it definitely outlines a new possibility to use the latest developments in computer graphicsand vision field into the core engineering domain. 11 lgorithm 5:
Create a tree to get the final Scad file
Result:
Writes the final scad file in a file-path mentioned
Data:
Takes in a single list of parent followed by it’s child list, which only as node object for each child / parent ispresent /* Note that node object has no operation set then it is parent, it’s child followsuntil next parent is found */ Function createTree( nodes,filename ) :if len(nodes) == then print(”No shapes detected”); return string = ”;present = node(); // Initialize empty node present.left = nodes[0]; // Add the first node in left child nodes[0].name() ; // Generates function/string for the shape as in openscad present.string = nodes[0].string ; // Add the generated string to the present node if len(nodes) == thenwritetofile (filename,present.string); // If there is only one node, write it to the file for i,object in enumerate(nodes[1:]) do object.name(); if object.operation ! = ’None’ // If Node is child of a parent shapes thenif present.right == ’None’ // no right child then /* update the present.string and string value and add the child shape nodeas the right child of the present node */ else /* If right is not free, create a new node and make the present node asleft child to the new node and make new node as present and updatepresent.string and string value */ else /* New parent, create a new separate tree with parent as the left child nodeand re-initialize string to empty string */ writetofile (filename,present.string); References [1] Aldefeld, B., 1983. On automatic recognition of 3d structures from 2d representations. Computer-Aided Design 15, 59–64.[2] Cayiroglu, I., 2009. A new method for machining feature extracting of objects using 2d technical drawings. Computer-Aided Design 41,1008–1019.[3] Chen, Z., Perng, D.-B., 1988. Automatic reconstruction of 3d solid objects from 2d orthographic views. Pattern Recognition 21, 439–449.[4] Douglas, D., Peucker, T., 1973. Algorithms for the reduction of the number of points required to represent a digitized line or its caricature. TheCanadian Cartographer 10, 112–122.[5] Geng, W., Wang, J., Zhang, Y., 2002. Embedding visual cognition in 3d reconstruction from multi-view engineering drawings. Computer-AidedDesign 34, 321–336.[6] Gimenez, L., Hippolyte, J.-L., Robert, S., Suard, F., Zreik, K., 2015. Review: reconstruction of 3d building information models from 2dscanned plans. Journal of Building Engineering 2, 24–35.[7] Gujar, U., Nagendra, I., 1989. Construction of 3d solid objects from orthographic views. Computers and Graphics 13, 505–521.[8] Kargas, A., Cooley, P., Richards, T., 1988. Interpretation of engineering drawings as solid models. Computer-Aided Engineering Journal 5, 67.[9] Lequette, R., 1988. Automatic construction of curvilinear solids from wireframe views. Computer-Aided Design 20, 171–180.[10] Liu, C.-H., Perng, D.-B., Chen, Z., 1994. Automatic form feature recognition and 3d part reconstruction from 2d cad data. Computers andIndustrial Engineering 26, 689–707.[11] Madurai, S., Lin, L., 1992. Rule-based automatic part feature extraction and recognition from cad data. Computers and Industrial Engineering
22, 49–62.[12] Meeran, S., Pratt, M., 1993. Automated feature recognition from 2d drawings. Computer-Aided Design 25, 7–17.[13] Nagendra, I., Gujar, U., 1988. 3-d objects from 2-d orthographic views—a survey. Computers and Graphics 12, 111–114.[14] Preiss, K., 1984. Constructing the solid representation from engineering projections. Computers and Graphics 8, 381–389.[15] Ramer, U., 1972. An iterative procedure for the polygonal approximation of plane curves. Computer Graphics and Image Processing 1,244–256.[16] Shi, Y., Zhang, Y., Xia, K., Harik, R., 2020. A critical review of feature recognition techniques. Computer-Aided Design and Applications 17,861–899.[17] Yuksel, C., 2015. Sample elimination for generating poisson disk sample sets. Computer Graphics Forum 34, 25–32.
13D Model Point cloud Time (in sec)34.6536.3238.8047.27Table 2: Point cloud