使用python进行CAD程序 [英] Using python for a CAD program

查看:593
本文介绍了使用python进行CAD程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对使用python开始为

电气设计编写CAD程序感兴趣。我刚读完史蒂文鲁宾的书,我已经用了b和真实的这本书。 EDA工具,我有一个MSEE,所以我知道我想要的*

结束了这个;我从来没有接受过这个

量级的编程任务。我已经看到有些人正在使用python作为实用语言

用于现有的CAD环境,而且我还发现了一些人写了一个b
$ b用python的2d绘图工具,很酷。我最近一直在用python玩b $ b,到目前为止有一个SPICE解析器

半写(它会做生产规则,但还没有语法树。 ..)

我想知道python专家是否可以在以下几个方面提供一些关于

python'效率/效用的意见,也许在哪里? />
有些东西需要用C ++和/或pyrex:


1.数据库。我不是指sql类型数据库,而是设计数据库,

包含任何给定设计的所有组件,包括

原理图,布局,模拟参数等。我不担心关于python执行奇特数据结构的能力,但是我想知道

它在效率方面会怎样事情变得非常重要。如果

替代品是自制的C ++链接列表,属性,数组,二进制

树,内存管理等,它看起来像python'的能力如果我这样做的话,所有这些整齐地没有等待发生的所有这些整齐地做好了这一切

我自己非常值得因为它可能导致的效率损失

。超级一般性。


2. GUI。是的,我知道你可以用qt,gtk,tkinter等做guis。我是

谈论花式guis做alpha混合,动画,不错

着色/渐变等,以快速,流畅,光滑的方式,这样,移动滚动条或摇动鼠标会产生类似游戏的快速响应时间,以及这让这个程序感觉你实际上是21世纪的b $ b ...这是一个*互动的*

环境,我f ***国王讨厌粗鲁,所以真正的颜色是必须的。这可以在linux和windows之间移植吗?有可能

来做整件事吗?在opengl,甚至是2D的东西?我想我不会在这里知道关于guis的信息。我担心的是,如果我尝试在linux中执行超过8位颜色的操作,我的应用程序将变成

x-hell,闪烁

后台窗口和来自有关位平面的服务器。

也许我需要在开发方面更多地使用linux

才能评论这个,因为我觉得我正在工作在旧的

信息在这里...


3.计算的东西。我想要真正繁重的计算需要用c ++完成,特别是如果我愚蠢到可以编写我自己的

模拟器,我的大脑似乎想要做(我正在想象一个小小的b / b
本垒打辛普森大脑,它自己的想法告诉我该怎么做......)。

但是其他的东西怎么样呢有关布局的规则和限制,

路由,压缩,撤消/重做等?这些并不是真的很贵,我想不出来,但是对数据库做了很多话。我可能会在

C ++中写一些更快的东西吗? (答案:否)。


4.可编程性。我想这是一个扣篮,相对说来,要说有一个python翻译器作为设计的一部分

系统。但是我如何自定义命令窗口来做自定义的事情

喜欢添加特殊的快捷方式(例如''''带来帮助,或帮助

命令a la Matlab ),或在API程序中制作API?我不是在概念上确定如何以智能的方式将嵌入式python解释器合并到CAD程序的其余部分,所以有些东西是

暴露,但不是全部,并且与

图形部分动态交互,例如,在控制台窗口中可以使用上下文相关帮助

,或者你可以访问当前所选对象的有关

的信息,或者你可以从基于你当前图形上下文的命令

行做一些事情。 />

5.线程和并行。关于这一点的一个问题是,我会像在那里一样运行一些实时模拟器,所以当你改变零件的价值时,输出会发生变化,我希望能够利用多处理器,或双核,或其他什么来赚取b $ b。我已经看到了
在python中看到假的多线程(读过它,但我还没有完成

),但这并没有真正使用来自单独的

处理器的额外周期。


那我为什么要考虑这个呢?我用了一些真实的 CAD系统,

和使用它们,显而易见的方法是在20年内共同使用b / b
并削弱用户体验。所以基本上我想用我漂亮的基于python的CAD系统来接管世界,因为

它的使用非常美观和有趣,如此灵活,以至于我对任何给定新想法的市场时间比现有工具短5倍。


对于上述人士的任何评论实际上写的东西

将不胜感激! :)


谢谢

ms

Hi, I''m interested in using python to start writing a CAD program for
electrical design. I just got done reading Steven Rubin''s book, I''ve
used "real" EDA tools, and I have an MSEE, so I know what I *want* at
the end of this; I just have never taken on a programming task of this
magnitude. I''ve seen that some are using python as a utility language
for existing CAD environments, and I''ve also found some guy who''s
writing a 2d drafting tool with python, which is cool. I''ve been
playing with python recently and so far have a SPICE parser
half-written (it''ll do production rules, but no syntax trees yet...)
I''m wondering if the python experts can provide some opinion on
python''s efficiency/utility in the following areas, and perhaps where
some things will need to be in C++ and/or pyrex:

1. Databases. I don''t mean sql type database, but design databases,
which contain all the components for any given design, including
schematics, layout, simulation parameters, etc. I''m not concerned
about python''s ability to do fancy data structures, but I''m wondering
how it''ll go in terms of efficiency when things get really big. If the
alternative is home-brewed C++ linked-lists, attributes, arrays, binary
trees, memory management, etc., it looks like python''s ability to do
all this neatly without all the bugs waiting to happen if I did this
myself are well worth the efficiency loss that may result from its
uber-generality.

2. GUI. Yes, I know you can do guis with qt, gtk, tkinter, etc. I''m
talking of fancy guis that do alpha blending, animations, nice
shading/gradients, etc. in a quick, smooth, and slick way, such that
moving a scroll bar or jiggling the mouse yields fast game-like
response time, and which gives this program the feeling that you''re
actually in the 21st century... ie this is an *interactive*
environment, and I f***king hate crass-hatching, so real colors is a
must. Can this be portable between linux and windows? Is it possible
to "do the whole thing" in opengl, even the 2d stuff? I guess I dont
know enough about guis here. My fear is that my app will turn into
x-hell if I try to do more than 8-bit colors in linux, with flashing
background windows and complaints from the server about bit planes.
Maybe I need to play with linux a bit more from the development side
before commenting on this, since I get the feeling I''m working on old
information here...

3. Computational stuff. I imagine the really heavy computing needs to
be done in c++, especially if I''m stupid enough to write my own
simulator, which my brain seems to want to do (I''m imagining a small
homer simpson brain with a mind of its own telling me what to do...).
But what about other things like rules and constraints about layout,
routing, compaction, undo/redo, etc? These aren''t really
computationally expensive, I don''t think, but do munge about quite a
bit with the database. Is it likely I''ll write something faster in
C++? (answer: no).

4. Programmability. I imagine this is a slam-dunk, relatively
speaking, to have a python interpreter as part-and-parcel of the design
system. But how do I customize the command window to do custom things
like adding special shortcuts (eg ''?'' brings up help, or help on
commands a la Matlab), or making an API into the CAD program? I''m not
sure conceptually how to merge an embedded python interpreter into the
rest of the CAD program in an intelligent way, so some stuff is
exposed, but not all, and which interacts dynamically with the
graphical portion so that, for instance, context-sensitive help is
available in the console window, or so you can access information about
the currently selected object, or so you can do stuff from the command
line that is based on your current graphical context.

5. Threads and parallelism. One of the things about this is that I''d
like there to be some real-time simulator running so when you change
the values of parts, the output changes, and I''d like to be able to
take advantage of mulitple processors, or dual-core, or whatever. I''ve
seen fake multi-threading in python (read about it, but I haven''t done
it), but that doesn''t really use any extra cycles from a separate
processor.

So why am I thinking about this? I''ve used a few "real" CAD systems,
and from using them, it''s obvious the modus is to kludge shit together
over 20 years and screw the user experience. So basically I''d like to
take over the world with my nifty new python-based cad system because
it''s so beautiful and fun to use, and so flexible that my time to
market for any given new idea is 5x shorter than the existing tools.

Any comments on the above from people who''ve actually written stuff
would be greatly appreciated! :)

thanks
ms

推荐答案

艺术哈斯不时发布一个名为PythonCad

的程序,他坚持认为:

http://tinyurl.com/o36t8


此外,这里是在Cad上搜索此论坛:

http://tinyurl.com/nuobe

Art Haas posts from time to time regarding a program called PythonCad
that he maintains:

http://tinyurl.com/o36t8

Also, here is a search of this forum on "Cad":

http://tinyurl.com/nuobe


63*******@sneakemail.com 写道:
63*******@sneakemail.com writes:
我对使用python开始为电气设计编写CAD程序感兴趣。我刚读完史蒂文鲁宾的书,我已经使用了真实的书。 EDA工具,我有一个MSEE,所以我知道我想要*在这个结尾;我从未接受过这种规模的编程任务。我已经看到有些人正在使用python作为现有CAD环境的实用语言,我也找到了一些用python编写2d绘图工具的人,这是凉。我最近一直在和python一起玩,到目前为止有一个SPICE解析器
半写(它会做生产规则,但还没有语法树......)
我我想知道python专家是否可以在以下方面提供关于python'效率/效用的一些意见,也许在某些事情中需要用C ++和/或pyrex:

1.数据库。我不是指sql类型的数据库,而是设计数据库,其中包含任何给定设计的所有组件,包括原理图,布局,模拟参数等。我不关心替代品是家庭酿造的C ++链接列表,属性,数组,二进制树,内存管理等,它看起来像python'能够做到这一切整齐地没有所有的错误等待发生,如果我这样做
我自己非常值得效率损失,这可能是由于它的优越性。

2. GUI。是的,我知道你可以用qt,gtk,tkinter等做guis。我是在谈论花哨的guis,快速进行alpha混合,动画,漂亮的
着色/渐变等,流畅,光滑的方式,这样,移动滚动条或摇晃鼠标会产生类似游戏的快速响应时间,这让这个程序感觉你实际上是在21世纪...即这是一个*互动*环境,而且我讨厌粗暴的孵化,所以真正的颜色是必须的。这可以在linux和windows之间移植吗?是否有可能做完整件事。在opengl,甚至是2D的东西?我想我在这里对guis知之甚少。我的担心是,如果我尝试在linux中执行超过8位颜色,闪存背景窗口以及来自服务器的关于位平面的抱怨,我的应用程序将转变为地狱。
也许我需要在开发方面更多地使用linux来评论这个,因为我觉得我正在处理旧的
信息......

3.计算的东西。我想真的很重要的计算需要用c ++完成,特别是如果我愚蠢到可以编写我自己的模拟器,我的大脑似乎想做(我想象的是小本垒打辛普森大脑有自己的想法告诉我该怎么做......)。
但其他的事情如规则和约束布局,
路由,压缩,撤消/重做等?这些并不是真的计算成本昂贵,我不会想到,但是对数据库做了很多事情。我可能会在C ++中写一些更快的东西吗? (回答:不)。

4.可编程性。我认为这是一个灌篮,相对说来,有一个python解释器作为设计
系统的一部分。但是我如何自定义命令窗口来做自定义的事情
如添加特殊的快捷方式(例如''''提示帮助,或帮助
命令matlab),或者将API编入CAD程序?我不是在概念上确定如何以智能的方式将嵌入式python解释器合并到CAD程序的其余部分,因此有些东西被曝光,但不是全部,以及与
图形部分动态交互,例如,在控制台窗口中可以使用上下文相关的帮助,或者您可以访问有关当前所选对象的信息,或者您可以从基于当前图形上下文的命令行开始。

5.线程和并行。关于这一点的一个问题是,我希望有一些实时模拟器运行,所以当你改变零件的价值,输出改变,我想能够利用多处理器,或双核,或其他什么。我已经在python中看到了假的多线程(读过它,但我还没有完成它),但是这并没有真正使用来自单独的任何额外周期处理器。

为什么我在想这个?我用了一些真实的 CAD系统,以及使用它们,显而易见的是,这种方式是将20多年的时间混合在一起,并且扼杀了用户体验。所以基本上我想用我漂亮的基于python的新系统来接管世界,因为它使用起来非常美观和有趣,而且非常灵活,以至于/>任何给定新想法的市场都比现有工具短5倍。

对于那些真正写过东西的人的上述评论将非常感谢! :)

感谢
ms
Hi, I''m interested in using python to start writing a CAD program for
electrical design. I just got done reading Steven Rubin''s book, I''ve
used "real" EDA tools, and I have an MSEE, so I know what I *want* at
the end of this; I just have never taken on a programming task of this
magnitude. I''ve seen that some are using python as a utility language
for existing CAD environments, and I''ve also found some guy who''s
writing a 2d drafting tool with python, which is cool. I''ve been
playing with python recently and so far have a SPICE parser
half-written (it''ll do production rules, but no syntax trees yet...)
I''m wondering if the python experts can provide some opinion on
python''s efficiency/utility in the following areas, and perhaps where
some things will need to be in C++ and/or pyrex:

1. Databases. I don''t mean sql type database, but design databases,
which contain all the components for any given design, including
schematics, layout, simulation parameters, etc. I''m not concerned
about python''s ability to do fancy data structures, but I''m wondering
how it''ll go in terms of efficiency when things get really big. If the
alternative is home-brewed C++ linked-lists, attributes, arrays, binary
trees, memory management, etc., it looks like python''s ability to do
all this neatly without all the bugs waiting to happen if I did this
myself are well worth the efficiency loss that may result from its
uber-generality.

2. GUI. Yes, I know you can do guis with qt, gtk, tkinter, etc. I''m
talking of fancy guis that do alpha blending, animations, nice
shading/gradients, etc. in a quick, smooth, and slick way, such that
moving a scroll bar or jiggling the mouse yields fast game-like
response time, and which gives this program the feeling that you''re
actually in the 21st century... ie this is an *interactive*
environment, and I f***king hate crass-hatching, so real colors is a
must. Can this be portable between linux and windows? Is it possible
to "do the whole thing" in opengl, even the 2d stuff? I guess I dont
know enough about guis here. My fear is that my app will turn into
x-hell if I try to do more than 8-bit colors in linux, with flashing
background windows and complaints from the server about bit planes.
Maybe I need to play with linux a bit more from the development side
before commenting on this, since I get the feeling I''m working on old
information here...

3. Computational stuff. I imagine the really heavy computing needs to
be done in c++, especially if I''m stupid enough to write my own
simulator, which my brain seems to want to do (I''m imagining a small
homer simpson brain with a mind of its own telling me what to do...).
But what about other things like rules and constraints about layout,
routing, compaction, undo/redo, etc? These aren''t really
computationally expensive, I don''t think, but do munge about quite a
bit with the database. Is it likely I''ll write something faster in
C++? (answer: no).

4. Programmability. I imagine this is a slam-dunk, relatively
speaking, to have a python interpreter as part-and-parcel of the design
system. But how do I customize the command window to do custom things
like adding special shortcuts (eg ''?'' brings up help, or help on
commands a la Matlab), or making an API into the CAD program? I''m not
sure conceptually how to merge an embedded python interpreter into the
rest of the CAD program in an intelligent way, so some stuff is
exposed, but not all, and which interacts dynamically with the
graphical portion so that, for instance, context-sensitive help is
available in the console window, or so you can access information about
the currently selected object, or so you can do stuff from the command
line that is based on your current graphical context.

5. Threads and parallelism. One of the things about this is that I''d
like there to be some real-time simulator running so when you change
the values of parts, the output changes, and I''d like to be able to
take advantage of mulitple processors, or dual-core, or whatever. I''ve
seen fake multi-threading in python (read about it, but I haven''t done
it), but that doesn''t really use any extra cycles from a separate
processor.

So why am I thinking about this? I''ve used a few "real" CAD systems,
and from using them, it''s obvious the modus is to kludge shit together
over 20 years and screw the user experience. So basically I''d like to
take over the world with my nifty new python-based cad system because
it''s so beautiful and fun to use, and so flexible that my time to
market for any given new idea is 5x shorter than the existing tools.

Any comments on the above from people who''ve actually written stuff
would be greatly appreciated! :)

thanks
ms




作为BSEE,MSCS和使用Lisp和Prolog的开发人员

基于知识的工程(KBE)的结构和系统,我是b / b
对你要去的地方感兴趣。重新发明一些轮子没什么不对,但我总是喜欢从文献搜索开始。如果你这样做了,那么
并不清楚。至少,请看看:


1. OSS EE套件:
http://www.opencollector.org/
http://www.geda.seul.org/


我没有看到重写ngspice或Icarus Verilog--人们

这样做。另一方面,将好的DBMS放在gscheme后面

是有意义的。另外,我围绕geda编写Python脚本,并且讨论了嵌入Python的问题。

2.数据库:


本地,我们一直在努力与各种DBMS。似乎OO是强制性的
,所以我期待Postgresql继承,或(较小的

规模)ZODB。我真的不想从B +树种植一个。

http ://www.postgresql.org/
http:/ /www.zope.org/Products/StandaloneZODB

3. 2D CAD和游戏引擎:
http://directory.fsf.org/PythonCAD.html
http://pygame.seul.org/news.html


4。 3D CAD


我们在本地编写针对几个商业CAD软件包的Python代码

(我同意您的评估)。对于OSS的努力,

镇唯一的游戏似乎是:
http://www.opencascade.org/
http://free-cad.sourceforge.net/

5.基于知识的工程(KBE)推理引擎:


Python已经为你提供了懒惰的评估和记忆,但是一个基于prolog的后向链接引擎也有帮助。我们写了

CAD-engine-calls-python-and-prolog和

python-and-prolog-calls-CAD-engine scripts。
http://sourceforge.net/projects/pyprolog/
http://christophe.delord.free.fr/en/pylog/
http://arts.anu.edu.au/linguistics/P...pyfrompro.html
http://aspn.activestate.com/ASPN/Coo.../Recipe/303057


6.模拟

http://simpy.sourceforge。 net /


dissapation。

-

Harry George

PLM工程架构



As a BSEE, MSCS, and developer using Lisp and Prolog for
Knowledge-Based Engineering (KBE) of structures and systems, I''m
interested in where you are going. Nothing wrong with reinventing a
few wheels, but I always like to start with a literature search. It
wasn''t clear if you had done so. At a minimum, take a look at:

1. OSS EE suites:
http://www.opencollector.org/
http://www.geda.seul.org/

I don''t see rewriting ngspice or Icarus Verilog -- people of people
doing that. Putting a good DBMS behind gscheme on the other hand
makes sense. Also, I write Python scripts around geda and there has
been discussion of embedding Python.
2. Databases:

Locally, we have struggled with various DBMSs. It seems OO is
mandatory, so I look to Postgresql with inheritance, or (smaller
scale) ZODB. I really wouldn''t want to grow one from B+ trees.

http://www.postgresql.org/
http://www.zope.org/Products/StandaloneZODB

3. 2D CAD and game engines:
http://directory.fsf.org/PythonCAD.html
http://pygame.seul.org/news.html

4. 3D CAD

Locally we write Python code against several commercial CAD packages
(I agree with your assessment). For an OSS effort, the only game in
town seems to be:
http://www.opencascade.org/
http://free-cad.sourceforge.net/

5. Knowledge Based Engineering (KBE) inference engines:

Python already gives you lazy evaluation and memoizing, but a
prolog-based backward chaining engine helps too. We wrote
CAD-engine-calls-python-and-prolog and
python-and-prolog-calls-CAD-engine scripts.

http://sourceforge.net/projects/pyprolog/
http://christophe.delord.free.fr/en/pylog/
http://arts.anu.edu.au/linguistics/P...pyfrompro.html
http://aspn.activestate.com/ASPN/Coo.../Recipe/303057

6. Simulation

http://simpy.sourceforge.net/

Also need FEM for electromagnetic analysis, and CFD for heat
dissapation.
--
Harry George
PLM Engineering Architecture




隐藏的人写道:

Someone in hiding wrote:
您好,我对使用python开始为电气设计编写CAD程序感兴趣。
Hi, I''m interested in using python to start writing a CAD program for
electrical design.




Google for PythonCAD。


Skip



Google for PythonCAD.

Skip


这篇关于使用python进行CAD程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆