/// <summary> /// Called when geometry has been changed. /// </summary> protected override void OnModelChanged() { var mb = new MeshBuilder(); var p0 = this.Offset; //new Vector3(0, 0, 0); if (this.InnerDiameter >= this.OuterDiameter) this.OuterDiameter = this.InnerDiameter + 0.3; var d = this.Axis; d.Normalize(); var p1 = p0 - (d * (float)this.Length * 0.5f); var p2 = p0 + (d * (float)this.Length * 0.5f); mb.AddPipe(p1, p2, this.InnerDiameter, this.OuterDiameter, 64); this.Geometry = mb.ToMeshGeometry3D(); }