- Status Closed
- Percent Complete
- Task Type Task
- Category QCAD (main)
-
Assigned To
Andrew - Operating System All
- Severity Low
- Priority Very Low
- Reported Version Development
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
Attached to Project: QCAD Bugtracker
Opened by Andrew - 19.05.2011
Last edited by Andrew - 17.11.2015
Opened by Andrew - 19.05.2011
Last edited by Andrew - 17.11.2015
FS#83 - Part Library - Find Files / Generate Files
Create and extend part library.
Find Existing Files
Find files under a suitable license (e.g. creative commons) for inclusion into the QCAD part library:
- DXF / DWG files
- SVG files which we could convert to DXF with a command line converter or InkScape if possible.
- DXF files produced from SVG / with InkScape contain a lot of polylines with small line segments which interpolate arcs and circles.
- A ‘Convert Interpolating Line Segments’ tool could be used to convert line segments into arcs, ellipse arcs and circles.
- for c in 0...number of nodes: create arc with v[c], v[c+1], v[c+2]
- check if v[c+i] is also on arc for c+i<number of nodes
- if n nodes have been found which are all on arc and all segments have almost the same length and are relatively small compared to the whole drawing, convert them to arc
- A ‘Simplify Polyline’ tool could be used to remove nodes that don’t add a lot of information (almost straight connected line segments).
Parameterized Items
- Parameterized items use XDATA to let the script behind know which entities need to be changed in which way.
- The user can choose from all supported parameters shown in a table.
- The user can choose from options:
- Create dimensioning
- Create auxiliary lines
- Create center line
- Scaling
- Sectional drawing
- Hatching space
- Disadvantage compared to automatically generated items:
- It is not possible to add an item with it’s parameters to favorites, e.g. some specific screw often used in a drawing. To make that possible, the parameters has to be saved, too.
Links
[mostly old] Generate Items Automatically
- Research possibilities to turn data sheets into library parts, for example attached data sheet.
- Ideas:
- use an XML file for data entry, use an ECMAScript to generate symbols based on the XML file.
- Instead of writing a complete ECMAScript file to generate the geometry, it might be possible to simply draw one item and attach XDATA to the entities for information on how the item can be scaled, stretched, etc.
- E.g. a line might have the XDATA “transform” with value “translate(length-5, 0)” which would mean that the line has to be moved ‘length-5’ to the right, where ‘length’ is the current value of the ‘length’ parameter in the XML data file. Similarly, there could be functions like “moveEndpoint”, “moveStartpoint” or even “rotate”, “mirror”, etc.
- XML file could contain all data and refer to a .js file that is used to generate the specific drawing. E.g.:
<!-- XML document defines a name template to use for the generated parts: --> "DIN_912_M%1_L%2""din_912.js""DXF" <!-- Attributes to use for the name template --> "d" "L" <!-- For each type of the specific part, we define some parameters that are identical for that type (here M3): --> "3""5.5""2.5""3""18" <!-- For each of these elements, a DXF file is generated. This DXF file is generated with file name "DIN_912_M3_L22.dxf" and parameters d="3" D="5.5" s="2.5" k="3" b="18" L="22": --> "var1" "var2" "60" "M4""7""3""4""3""20" "var1" "var1" "22" "25" "30" "35" "40" "45" "50" "var2" "70"
The following sites would need further clarifications.