   $("#star").attr("d", pathString);
 
 drawStarWithCubicTips = () ->
+  if $straightPercentage.val() == "0"
+    drawCubicStar()
+    return
+
   innerPoints = calculateInnerPoints()
   outerPoints = calculateOuterPoints()
   [intermediatePoints1, intermediatePoints2] = calculateLineToCurveTransitionPoints(innerPoints, outerPoints)
-  [controlPoints1, controlPoints2] = calculateControlPoints(intermediatePoints1, intermediatePoints2, outerPoints)
+  [controlPoints1, controlPoints2] = calculateControlPointsFromIntermediate(intermediatePoints1, intermediatePoints2, outerPoints)
 
   points = _.zip(innerPoints.map(pointAsString), intermediatePoints1.map(pointAsString), controlPoints1.map(pointAsString), controlPoints2.map(pointAsString), intermediatePoints2.map(pointAsString))
 

    y: innerPoint.y + displacementVector.y
  }

calculateLineToCurveTransitionPoints = (innerPoints, outerPoints) ->
  percentage = $straightPercentage.val()
  points1 = calculateIntermediatePoints(innerPoints, outerPoints, percentage)

  shiftedInnerPoints = innerPoints.slice(1)
  shiftedInnerPoints.push(innerPoints[0])
  points2 = calculateIntermediatePoints(shiftedInnerPoints, outerPoints, percentage)

  [points1, points2]

calculateControlPoints = (intermediatePoints1, intermediatePoints2, outerPoints) ->
  percentage = $controlPercentage.val()
  points1 = calculateIntermediatePoints(intermediatePoints1, outerPoints, percentage)
  points2 = calculateIntermediatePoints(intermediatePoints2, outerPoints, percentage)

  [points1, points2]


drawLinearStar = () ->

  pathString = "M " + firstPoint + sectionStrings.join('') + " Z"
  $("#star").attr("d", pathString);

drawCubicStar = () ->
  innerPoints = calculateInnerPoints()
  outerPoints = calculateOuterPoints()
  [controlPoints1, controlPoints2] = calculateControlPoints(innerPoints, outerPoints)

  firstPoint = pointAsString(innerPoints[0])
  innerPoints.push(innerPoints.shift())
  points = _.zip(controlPoints1.map(pointAsString), controlPoints2.map(pointAsString), innerPoints.map(pointAsString))

  sectionStrings = points.map ([control1, control2, inner]) ->
    " C #{ control1 } #{ control2 } #{ inner }"

  pathString = "M #{ firstPoint } " + sectionStrings.join('') + " Z"
  $("#star").attr("d", pathString)


drawStarWithCircularTips = () ->
  innerPoints = calculateInnerPoints()
