(line_coords, mat_name, spy=False)
| 81 | scene.add(lines[1]) |
| 82 | |
| 83 | def draw_lines(line_coords, mat_name, spy=False): |
| 84 | if spy: |
| 85 | line_coords_f32a = new(Float32Array, line_coords.length) |
| 86 | _it = line_coords.items |
| 87 | for i in range(line_coords.length): |
| 88 | line_coords_f32a[i] = _it[i] |
| 89 | else: |
| 90 | line_coords_f32a = new(Float32Array, line_coords) |
| 91 | if mat_name == 'zero': |
| 92 | mat = zero_mat |
| 93 | elif mat_name == 'grid': |
| 94 | mat = grid_mat |
| 95 | else: |
| 96 | mat = other_mat |
| 97 | |
| 98 | geo = new(THREE.BufferGeometry) |
| 99 | geo.setAttribute('position', new(THREE.BufferAttribute, line_coords_f32a, 3)) |
| 100 | seg = new(THREE.LineSegments, geo, line_basic_mat) |
| 101 | |
| 102 | lsg = new(lsgeo.LineSegmentsGeometry) |
| 103 | lsg.fromLineSegments(seg) |
| 104 | l1 = new(line2.Line2, lsg, mat) |
| 105 | l1.computeLineDistances() |
| 106 | l2 = new(line2.Line2, lsg, mat) |
| 107 | l2.computeLineDistances() |
| 108 | lines[0].add(l1) |
| 109 | lines[1].add(l2) |
| 110 | |
| 111 | seg.geometry.dispose() |
| 112 | del geo |
| 113 | del seg |
| 114 | |
| 115 | def drawing_done(): |
| 116 | maybe_with_spy = "with SPy" if USE_SPY else "with pure Python" |
no test coverage detected