|
2 | 2 | using System.Collections;
|
3 | 3 | using System.Collections.Generic;
|
4 | 4 | using System.Diagnostics;
|
| 5 | +using System.Linq; |
5 | 6 |
|
6 | 7 |
|
7 | 8 | namespace g3
|
@@ -834,6 +835,12 @@ public void AppendLine(Segment3d seg, float size)
|
834 | 835 | f.AlignAxis(2, (Vector3f)seg.Direction);
|
835 | 836 | AppendBox(f, new Vector3f(size, size, seg.Extent));
|
836 | 837 | }
|
| 838 | + public void AppendLine(Segment3d seg, float size, Colorf color) |
| 839 | + { |
| 840 | + Frame3f f = new Frame3f(seg.Center); |
| 841 | + f.AlignAxis(2, (Vector3f)seg.Direction); |
| 842 | + AppendBox(f, new Vector3f(size, size, seg.Extent), color); |
| 843 | + } |
837 | 844 | public static void AppendBox(DMesh3 mesh, Vector3d pos, float size)
|
838 | 845 | {
|
839 | 846 | MeshEditor editor = new MeshEditor(mesh);
|
@@ -871,6 +878,22 @@ public static void AppendLine(DMesh3 mesh, Segment3d seg, float size)
|
871 | 878 |
|
872 | 879 |
|
873 | 880 |
|
| 881 | + public void AppendPathSolid(IEnumerable<Vector3d> vertices, double radius, Colorf color) |
| 882 | + { |
| 883 | + TubeGenerator tubegen = new TubeGenerator() { |
| 884 | + Vertices = new List<Vector3d>(vertices), |
| 885 | + Polygon = Polygon2d.MakeCircle(radius, 6), |
| 886 | + NoSharedVertices = false |
| 887 | + }; |
| 888 | + DMesh3 mesh = tubegen.Generate().MakeDMesh(); |
| 889 | + if (Mesh.HasVertexColors) |
| 890 | + mesh.EnableVertexColors(color); |
| 891 | + AppendMesh(mesh, Mesh.AllocateTriangleGroup()); |
| 892 | + } |
| 893 | + |
| 894 | + |
| 895 | + |
| 896 | + |
874 | 897 | /// <summary>
|
875 | 898 | /// Remove all bowtie vertices in mesh. Makes one pass unless
|
876 | 899 | /// bRepeatUntilClean = true, in which case repeats until no more bowties found
|
|
0 commit comments