public void DrawVolumes() { var scene = new Record3D(); scene.DrawPivot(System.Numerics.Matrix4x4.Identity, 2); scene.DrawCube(System.Numerics.Matrix4x4.CreateTranslation(5, 0, 0), Color.Red, Color.Green, Color.Blue); scene.DrawCube(System.Numerics.Matrix4x4.CreateTranslation(7, 0, 0), (Color.Black, 0.1f)); var doc = new PlotlyDocumentBuilder().Draw(scene); AttachmentInfo.From("Drawing.html").WriteAllText(doc.ToHtml()); }
private static Record3D CreateDefaultScene1() { var context = new Record3D(); context.DrawPivot(Matrix4x4.CreateTranslation(-10, 0, -10), 2); float diamenter = 1; context.DrawSegment(Vector3.Zero, Vector3.One * 3, diamenter, (COLOR.White, LineCapStyle.Triangle, LineCapStyle.Triangle)); context.DrawSegment(Vector3.One * 3, Vector3.UnitX * 7, diamenter, COLOR.Blue); context.DrawSegment(Vector3.One * 3, Vector3.One * 3, diamenter, COLOR.Black); context.DrawSurface((COLOR.Red.WithAlpha(180), COLOR.Yellow, 0.25f), new Vector3(-1, 0, 10), new Vector3(1, 0, 10), new Vector3(0, 1, 10)); context.DrawSegment(Vector3.Zero, Vector3.UnitX * 7, diamenter, COLOR.Violet); context.DrawSegment(new Vector3(9, 0, 0), new Vector3(9, 10, 0), diamenter, ((COLOR.Red, COLOR.Black, 0.1f), LineCapStyle.Round, LineCapStyle.Round)); context.DrawSphere(new Vector3(-9, 0, 0), 2, (COLOR.Red, COLOR.Blue, 0.1f)); // degenerated line falls back to sphere context.DrawSegment(new Vector3(0, 9, 0), new Vector3(0, 9, 0), 2, COLOR.Yellow); return(context); }