kozbot / kecb Goto Github PK
View Code? Open in Web Editor NEWPython program to generate industrial electrical symbol library.
License: MIT License
Python program to generate industrial electrical symbol library.
License: MIT License
With the number of variables and options this may be the best way to store data for generating PLC blocks and as a bonus the json can be generated via a utility script.
Any time a draw method is called it should add to a list for that block rectangle coordinates. From that list we can calculate the actual outer extents plus the block rounded extents which will be needed to implement circuits so symbols don't overlap.
With the exception of arcs being defined differently in SVG and a pain to translate the rest is pretty straightforward so this may be feasible.
Symbols such as a disconnect, or circuit breaker have variations that are dependent on the number of poles. There should be a multiple pole drawing method and some way of indicating what number of poles are supported. Fallback to using the default draw method multiple times with applicable offset.
Note to self to explore using A* pathfinding for determining optimal wiring path.
Deprecate pack_transform from utils and replace with actual class.
Need a couple of title blocks. Use 0.17 paper margin for now (typical on US printers)
Horizontal B Size 2 Column
Horizontal B Size No Columns
Variables:
Drawn By / Date / Initials
Sheet Number
Rev Number
Description
Drawing Number
Standards Block
Legal Block
Wiring Specs
Design considerations for future:
Ability to specify and automatically add Rows / Columns
Ability to specify and add power rails
Import logo
A simple circuit at first. One line with a NO PB through a NC PB to a relay.
PB left aligned
Relay right aligned
NC PB unaligned
Consider ideal spacing between components and left/right extents.
Also keep in mind how to implement AND within circuit for next step of drawing a simple latching circuit.
Components should be drawn by alignment left->none->right in order they were added.
Raise exception for now if total circuit length would exceed left and right borders.
Still not correct, should default to 0.1 or a function of the block size.
Need a helper method to draw polyline rectangle using two points. Raise valueerror if p1.x == p2.x or p1.y == p2.y
Make it irrelevant what two points are supplied, they should just have to be opposing corners and calculate the rest.
It seems that in general I use 1/2 size symbols on the terminal strip / field wiring drawings. Maybe making a subfolder outputting some at smaller scale for this purpose would be worth it.
Need 3 and 4 pole disconnects, both standard and circuit breaker.
Noticed this yesterday setting up some parts. Think this is leftover from debugging drawings and might be already fixed locally.
Base off existing multipole logic where default version called until changed as usually this is enough.
Currently scaling is done directly on variables and offset by adjusting the origin for the current drawing cycle. It is probably wiser to use a transformation matrix in the builder and utilize that for drawing calls.
Need to explore options for exporting and importing symbols in ascii or binary format. Write some tests to export, import, export again and compare the two exports to make sure they are identical.
Need to check if it exists and os.mkdirs if not.
For some reason that seems to be a common search that leads here. Not something originally intended, but maybe?
Need to take a look at if there is any reason to have a second argument just for scale since it is in transform already. If we just always apply transform the conditional if transform is None sprinkled all over exporter can go. Transform should probably use it's own 'TRANSFORM_SCALE_DEFAULT' set to 'UNIT_SCALE' or something in case I want to change later. Default of 1 makes sense when debugging / creating symbols but probably not the best default for normal running.
Need to create a wiki page outlining the overall goals of what I am trying to accomplish.
At minimum the always available linestyles should be dashed (2x, 1x, 0.5x) , dotted, and phantom.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.