three绘制电路图效果

代码语言:html

所属分类:布局界面

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
html,
body {
  padding: 0;
  margin: 0;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  background: #1B2B34;
}
</style>

</head>
<body translate="no">
<script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/three.js"></script>
<script >
console.clear();
const CellNeighbors = {
  topLeft: 'topLeft',
  top: 'top',
  topRight: 'topRight',
  left: 'left',
  right: 'right',
  bottomLeft: 'bottomLeft',
  bottom: 'bottom',
  bottomRight: 'bottomRight'
};

const rand = (min, max) => min + Math.random() * (max - min);

const notCrossedOver = (node, dir, visited) => {
  let a;
  let b;
  switch (dir) {
    case CellNeighbors.topRight:
      a = node.getNeighbor(CellNeighbors.left);
      b = node.getNeighbor(CellNeighbors.bottom);
      break;
    case CellNeighbors.bottomRight:
      a = node.getNeighbor(CellNeighbors.left);
      b = node.get.........完整代码请登录后点击上方下载按钮下载查看

网友评论0