A little summary of recent projects related to CAD data
1. About list<object> usage in Java.
It can save a number of different elements, but how do you determine what kind of element it is when you take an element? When you take an element, you can determine what type of element is in the list by calling the GetClass method and comparing it to the class. The element is then coerced into a type cast.
2. Reference block coordinates for data in AutoCAD.
A block reference in a DXF file has a definition of coordinates that can be inserted into an entity segment to insert these reference blocks. But the coordinates of the insertion point are only in the insert, so how do you determine the coordinates of the elements of the reference block? And what does the insertion point mean?
The law is explored by calculating coordinates: the first insertion point is the position of the coordinate origin (0,0) in the reference block after the insert. In this way, the coordinates of the elements of the reference block after insertion can be determined by calculating the relative relationship of the points to the origin of the coordinates. Specifically, the code for scaling, rotating, and other axes of each axis is as follows:
3. Read about the Bufferreader stream in Java. If it is read, it is checked for not the desired data, but it cannot be simply discarded because the code that might be followed is needed. It means that the data is read out and then put back. What do you do?
Mark the previous position by calling the mark () method, and then retreat back to the position of the last mark-marked stream by calling the Reset () method. (here to take full account of the situation, do not because Mark's place is not enough or wrong, causing the cycle of death.) This should be related to the tag stream position variable in the buffer data structure of the file.
The Java list<object> How to determine the element category, the fallback of the input stream, and the coordinate transformation of the reference block in AutoCAD.