/// <summary> /// Creates an extruded shape that ends in a point like a cone. Also called by the 2D Shape Editor window. /// </summary> /// <param name="project">The project to be copied into the brush.</param> public void ExtrudePoint(Project project) { // store a project copy inside of this brush. this.project = project.Clone(); // store the extrude mode inside of this brush. extrudeMode = ExtrudeMode.ExtrudePoint; // build the polygons out of the project. m_LastBuiltPolygons = BuildConvexPolygons(); // build the brush. isDirty = true; Invalidate(true); }
/// <summary> /// Creates an extruded shape towards a point but is then capped causing a trapezoid. Also /// called by the 2D Shape Editor window. /// </summary> /// <param name="project">The project to be copied into the brush.</param> public void ExtrudeBevel(Project project) { // if the depth and clip depth are identical, extrude a point instead. if (project.extrudeDepth.EqualsWithEpsilon(project.extrudeClipDepth)) { ExtrudePoint(project); return; } // store a project copy inside of this brush. this.project = project.Clone(); // store the extrude mode inside of this brush. extrudeMode = ExtrudeMode.ExtrudeBevel; // build the polygons out of the project. m_LastBuiltPolygons = BuildConvexPolygons(); // build the brush. isDirty = true; Invalidate(true); }
/// <summary> /// Creates an extruded shape that revolves around. Also called by the 2D Shape Editor window. /// </summary> /// <param name="project">The project to be copied into the brush.</param> public void RevolveShape(Project project) { // store a project copy inside of this brush. this.project = project.Clone(); // flip project horizontally if revolving left. if (!this.project.revolveDirection) { FlipProjectHorizontally(); } // store the extrude mode inside of this brush. extrudeMode = ExtrudeMode.RevolveShape; // build the polygons out of the project. m_LastBuiltPolygons = BuildConvexPolygons(); // build the brush. isDirty = true; Invalidate(true); // un-flip project horizontally if revolving left. if (!this.project.revolveDirection) { FlipProjectHorizontally(); } }
/////////////////////////////////////////////////////////////////////////////////////////// // PUBLIC API // /////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Gets a copy of the embedded project that once upon a time created this brush. /// </summary> /// <returns>A copy of the embedded project.</returns> public Project GetEmbeddedProject() { // create a copy of the embedded project using JSON and return it. return(project.Clone()); }