-------------------------------- Pascal Lines and Brianchon Lines -------------------------------- .. image:: render.png :width: 750px :align: center In this example we are going to create and display Pascal lines, their intersections, Brianchon lines and diagonals on a quadric surface. You can see the full code at :download:`pascal.py <../../../../examples/blender/geometry/pascal.py>`. .. contents:: :local: :backlinks: none Setup ===== We start off by importing the necessary libraries. .. literalinclude:: ../../../../examples/blender/geometry/pascal.py :language: python :start-after: [setup-1] :end-before: [setup-1] We are also going to clear the whole scene. .. literalinclude:: ../../../../examples/blender/geometry/pascal.py :language: python :start-after: [setup-2] :end-before: [setup-2] Functions ========= Now we will define the a helper function which will draw projective lines. .. literalinclude:: ../../../../examples/blender/geometry/pascal.py :language: python :start-after: [functions-1] :end-before: [functions-1] Math ==== With the set up complete, we can now calculate the intersections. First we have to create a quadric. .. literalinclude:: ../../../../examples/blender/geometry/pascal.py :language: python :start-after: [math-1] :end-before: [math-1] With this we can create the actual lines and intersections. .. literalinclude:: ../../../../examples/blender/geometry/pascal.py :language: python :start-after: [math-2] :end-before: [math-2] Visualization ============= Finally we can visualize all of this in Blender. We start by creating the quadric Blender object. .. literalinclude:: ../../../../examples/blender/geometry/pascal.py :language: python :start-after: [visualization-1] :end-before: [visualization-1] Next we dualize the quadric. .. literalinclude:: ../../../../examples/blender/geometry/pascal.py :language: python :start-after: [visualization-2] :end-before: [visualization-2] And finally we visualize the lines, intersections and points. .. literalinclude:: ../../../../examples/blender/geometry/pascal.py :language: python :start-after: [visualization-3] :end-before: [visualization-3]