电子电路图分量连接算法 [英] Electronic cIrcuit diagram component connection algorithm

查看:218
本文介绍了电子电路图分量连接算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创造它的目的是为模拟如何电子电路工作的Web服务。该项目是不是即使在alpha阶段呢。

I am creating a web-service which is aimed to simulate how do electronic circuits work. The project is not even in the Alpha stage yet.

我坚持这个项目的一些重要的里程碑:当一个人试图一个组件的引脚连接到其他引脚 - 应建立在连接线。

I am stuck with some important milestone of the project: when one tries to connect one component's pin to some other pin - the connection line should be built.

首先,连接线只是一条直线,几乎没有任何办法去改变它。

First of all, the connection line was just a straight line, without almost any way to change it.

通过添加,移动和删除点,其中所确定的线是如何弯曲的可能性。然后它成为某种方式弯曲线。

Then it became somehow bended line with the possibility to add, move and delete points, which determined how the line is bended.

而现在使用的 A被创建它(连接线)* 算法。

的实施还不够呢,所以编辑* - 生成的连接线是不是一个好主意,事业失败了很多。

The implementation is not well yet, so editing A*-generated connection line is not a good idea, 'cause it fails a lot.

想法为连接线的创建算法就是如下:

The idea for the connection line creation algorithm is just as follows:

  1. 确定的启动结束的点

之间找到的启动的路径和结束的,不重叠的任何现有组件的边界框

find a path between start and end, which does not overlap any existing component' bounding box

创建一组的基点的 - 坐标表,从步骤#得到2 +的启动的在堆+的结束在尾部

create a set of base points - a list of coordinates, got from the step #2 + start at the heap + end at the tail

创建一组线,将形成一条连接线:

create a set of lines which will form a connection line:

for (var i = 1; i < points.length; i++) {
    var p0 = points[i - 1], p1 = points[i], 
        line = MooChip.paper.path(Raphael.format('M%1,%2L%3,%4', p0.x, p0.y, p1.x, p1.y));
}

问题是,连接线的可以重叠,而他们只能相交......嗯,其实还有另外一个问题:我甚至不能想象如何可以实现连接线连接,喜欢这里,左下图:

The problem is that connection lines could overlap, while they must intersect only... Well, actually there is another problem: i could not even imagine how one could implement connection lines connection, like here, the bottom-left image:

现在的问题是:我应该如何构建连接路径(使它大多接近精心设计的线路图,让我们说),我该如何实现原理路口

The question is: how should i build the connection path (to make it mostly close to the well-designed circuit diagram, let's say) and how can i implement schematic junctions?

推荐答案

首先,在这一刻我不能给整体的解决方案,但也许它会帮助:

Firstly, at this moment i can't give whole solutions, but maybe it will help:

  • 检查 graphflow 的项目,它的JavaScript画布视图构建图和对齐它基于连接,因为我看到。这是需要什么的电路(FE接地标志将只有一个连接来顶点,因此在架构的边界区域将被绘制)
  • 在这种方法应该用某种方式把它给电网,使所有连接的正交
  • 修改
  • 有关连接路径它只是多了一个元素,应对准他人。这就像晶体管,但太小,看的所有三个连接
  • check graphflow project, its javascript canvas view builds the graph and aligns it based on connections as i see. That is exactly what is needed for circuits (f.e. GND sign will be vertex with only one connection, so will be drawn at the boundary region of schema)
  • that approach should be modified somehow with putting it to grid and making all connections orthogonal
  • about "connection path" it is just one more element and should be aligned as others. It is like transistor, but too small to see all three connectors

这篇关于电子电路图分量连接算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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