dxf | DXF parser for node/browser | Frontend Framework library
kandi X-RAY | dxf Summary
kandi X-RAY | dxf Summary
DXF parser for node/browser. Uses several ES6 features in the source code (import, classes, let, const, arrows) but is packaged using babel so you can use it in legacy JS environments. Version 2.0 is a complete rewrite from the first attempt to write it in a SAX style, which wasn't really appropriate for a document with nested references (e.g inserts referencing blocks, nested inserts). Version 3.0 converted the codebase to use standard JS, ES6 imports, stopped using Gulp, and updated & removed some dependencies. Version 4.x is in progress and the aim is to use native SVG elements where possible, e.g. , etc. 4.0 introduces the element.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of dxf
dxf Key Features
dxf Examples and Code Snippets
Community Discussions
Trending Discussions on dxf
QUESTION
I would like to convert the drawings inside a .dxf file into g-code. There are tools doing that but I would like to code it myself. So, the very first part is to decode the .dxf format. Yet, the contents of the .dxf file does not look easy to decipher.
I downloaded a .dxf file here and opened it in a text editor.
I am also referring to this manual. It looks like what is inside a .dxf file is mostly style and configuration information and I tend to omit almost everything. So, 1. can you specify attributes that should not be omitted, if there are any?
As far as I know the figures are divided into multiple ENTITIES in a .dxf file. Therefore, I am only copy pasting the SECTION of ENTITIES. Note that there are 6 SECTIONS in the file and the last section (BLOCKS OBJECTS) is the longest one although I don't know what that part represents (Would be nice if you could explain).
In the code below, 10 and 20 should be representing X and Y positions and 42 should be representing the bulge. It is kind of possible to track the polyline. I consider extracting information from the file by using the TITLES as navigation points as well as the numbers like 10, 20 and 42. But there are two polylines below. So, 2. which polyline should I take into consideration and what is the purpose of the other?
...ANSWER
Answered 2022-Mar-22 at 20:03The last section (
BLOCKS
) is the longest one although I don't know what that part represents (Would be nice if you could explain).
The purpose of the BLOCKS
section is summaried in the manual you referred to:
The
BLOCKS
section contains an entry for each block reference in the drawing.
Think of a block as a group of entities that are grouped together as one element. The block has:
- Origin
- Rotation
- Scale
Such blocks are referenced in the drawing itself and each instance of the block is called an INSERT
.
So when you walk your ENTITIES
section and you hit an INSERT
entity, you then have to find its handle in the BLOCK
table and process the elements accordingly.
There are some DXF codes that are common to many entities and they are not always listed with the information for a specific entity type (like LWPOLYLINE
).
Look at this complete list for those numbers:
5: Entity handle; text string of up to 16 hexadecimal digits (fixed)
330: Soft-pointer handle; arbitrary soft pointers to other objects within same DXF file or drawing. Translated during
INSERT
andXREF
operations100: Subclass data marker (with derived class name as a string). Required for all objects and entity classes that are derived from another concrete class. The subclass data marker segregates data defined by different classes in the inheritance chain for the same object. This is in addition to the requirement for DXF names for each distinct concrete class derived from ObjectARX (see Subclass Markers)
This page is also useful.
Why are there 2
LWPOLYLINES
in the first place and why is it not only oneBLOCK
-ENDBLK
pair?
If you read through the section about BLOCKS
you'll see:
Model Space and Paper Space Block DefinitionsThree empty definitions always appear in the
BLOCKS
section. They are titled*Model_Space
,*Paper_Space
and*Paper_Space0
. These definitions manifest the representations of model space and paper space as block definitions internally. The internal name of the first paper space layout is *Paper_Space, the second is *Paper_Space0, the third is *Paper_Space1, and so on.
QUESTION
I'm doing maintenance on a GUI, made in C#, using Visual Studio (xaml technology).
There are several visual components I don't see in the design view, like the Telerik and DXF visual components. I have no idea if this is due to a general problems ("Visual Studio Design view has problems external visual components") or if this is a specific problem for the visual components' libraries ("Telerik is not viewable in Visual Studio's Design view" or "In order to see DXF visual components in Visual Studio's Design view, you need to configure ...").
An example of a Telerik visual component in the XAML:
...ANSWER
Answered 2022-Mar-14 at 01:52You should be able to add the Telerik controls manually by choosing the toolbox items. They have documentation on the process.
I don't know of an extension that exists already for DXP files on the Marketplace, but you can write your own Visual Studio extension to read in the file and tell Visual Studio how to format it.
This repository does such thing, but it uses a much simpler example to help guide you along the process.
QUESTION
ANSWER
Answered 2022-Mar-10 at 14:58Your TypeConverter derives from ExpandableObjectConverter, which means subproperties will be visible because of its GetPropertiesSupported method returning true.
In your TypeConverter, you simply need to override GetPropertiesSupported and return false.
QUESTION
I have been scratching my head for days understanding how to fully describe a block to insert in DXF. For background I am interested in the rules and behaviour of how to do this, not simply trying to find an existing library.
I can create a block in dxf, lets say this is a simple cube. I can then in the Entities section insert this block. To do this I enter the coordinates relative to the object coordinate system codes:(10, 20, 30), and the normal vector of the object codes:(210,220,230). There is also a value to rotate about the normal vector code: 50.
So there are two things to do:
- Calculate the normal vector for my object
- Calculate the object co-ordinates, given the world coordinates for the object.
To calculate the normal vector, I use quaternions to calculate the rotation applied to the world z-axis (0,0,1) if a yaw, pitch, or roll angle is applied (if not, I simply use the world z-axis). I can use the same quaternions to calculate the arbitrary x and y axis using the same rotation for each of the real world x and y axes. For those looking for more info, this link has a very clear explanation of how to calculate them. https://danceswithcode.net/engineeringnotes/quaternions/quaternions.html
To help you, this calculator can help confirm if this has been implemented correctly or not by checking the results:
Then to calculate the object co-ordinates I simply cross multiply the world coordinate with each of the arbitrary axes/normal axes.
For most scenarios this appears to work. However I am left at a loss for additional rules and requirements which I cannot see documented anywhere:
If only a yaw angle is applied (rotation about z), then the normal is still (0,0,1). We need to apply a rotation about z in the scenario that pitch and roll are zero.
If I alter the pitch, the normal vector can change from a negative y-coordinate to a positive one. This change in slope appears to affect the direction the vector is headed and if positive, requires a rotation about the normal of 180 degrees to correct it.
For some unknown reason when I apply a roll angle, my object is rotated around the normal by 90 degrees, and I need to apply a correction here.
I am struggling to find any more clear direction on this online. Does anyone have any thorough explanations that describe the behaviour above, or any pointer material?
...ANSWER
Answered 2022-Mar-09 at 06:32As suggested in another topic, a little matrix calculus can solve this issue.
Shortly, they are mainly two ways to describe the same Euler angles:
- Tait-Bryan angles (yaw, pitch, roll) rotations about X, Y, Z axis;
- Proper Euler angles (precession, nutation, intrisic rotation) rotations about Z, X, Z axis; AutoCAD uses the second one to describe a bloc orientation. The combination of precession and nutation provides the OCS transformation matrix and the intrinsic rotation is the rotation value of the block.
A little F# example with 3x3 matrices to describe 3d rotations.
QUESTION
Good afternoon, I am trying to use Eyeshot in a .NET Framework Web Application to create a Bitmap image. The steps of the process in my code are the following: I generate all the necessary Entities and then I add them to a Model control that is not visible in the Web Application; once all Entities are added, I use the ZoomFit() method to zoom to the desired Entities and then I use the RenderToBitmap() method to create the Bitmap image. The issue regards the ZoomFit() method: when executed, it gives the following error message: "Control's handle must be created first". The portion of code regarding the creation of the Model control is the following:
...ANSWER
Answered 2022-Mar-01 at 11:56This is a licensing issue. Eyeshot Trial version cannot be copied on other machines. The same problem would occur if you copy your app to a different Win10 machine.
QUESTION
I am learning how to use dlls and how to export them. I have created a small program that calls the different components(classes, methods, functions, ect.. ) of my dll file to use them. When I build the project I get no problem, but when I compile the test code I get this error.
Error translation: {The procedure entry point "?Start@K_WrapperTeigha_DXF_DWG@@QAEXXZ" was not found in the DLL "C:\Users\zboussaid\source\repos\WrapperTester\Debug"}.
The image shows that the start method, which is a function in my DLL file, cannot be found in the path where my test code is located. I have tried to configure my properties as shown in this drescription, but as I said, I get this error. I will be very grateful if you can help me
class definition:
...ANSWER
Answered 2022-Feb-22 at 07:36@YujianYao-MSFT & Kiner_shah I really appreciate your help. I have solved the problem. My problem was that I created the dll file on Friday and then got the idea to change the location of creating the dll file and forgot about it. Then on Monday I copied the old file which does not contain my start() method. So the problem was the wrong parameterization of the dll file setting.
QUESTION
Given a DXF file (2D CAD drawing), is it somehow possible to rasterise only part of it? Preferably in Python's ezdxf
. By the part of it, I mean the selected rectangular area, not a single layer.
Background: I'm struggling to rasterise quite a big DXF file with decent DPI in a reasonable time, so I thought that maybe there's a way to speed up the process by parallelising rasterising different parts of the drawing. I'm using ezdxf
with matplotlib
backend.
ANSWER
Answered 2022-Feb-03 at 04:55This solution renders the DXF file in 4 tiles including filtering the DXF entities outside the rendering area. But the calculation of the bounding boxes is also costly and the entities in the overlapping area are rendered multiple times, this means this solution takes longer as a single-pass rendering. But it shows the concept. The images fit perfect together the space is left to show that this are 4 images:
QUESTION
When reading an XLSM file with pandas I'm getting the following error:
...ANSWER
Answered 2022-Jan-28 at 12:02Alright I found the solution. For anyone who has the same problem: Upgrade openpyxl!
QUESTION
I am trying to modify this existing npm package without much success. I have wasted several hours troubleshooting would appreciate some guidance.
https://www.npmjs.com/package/dxf
I have forked the package into my Github account. I have then used npm to install the module locally (W10 running latest LTS Node).
...ANSWER
Answered 2022-Jan-20 at 12:43The matter has been resolved. I did not realise that you needed to compile the package when installing from github. Not something required when installing from NPM registry.
The module's package.json file has a script to run the compile process script.
npm run prepublishOnly
Took a little while to install the dependencies (browserify, babel, rimraf) but it compiled and now works...
QUESTION
I am trying to extract the following information from all PDF files within a folder, the PDF files are CV's: Email Address, First Name, Last Name for a work project.
I have successfully managed to extract Email Addresses using this code:
...ANSWER
Answered 2022-Jan-09 at 19:34You can find email information because there is logic behind it
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install dxf
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page