patt - QLHZ_Contour_CQ
  • CodeQuotidien ยท a collection of Computational Geometry for Architecture.
    Scroll down for recent posts or choose a platform from above to begin.

    Any posted code is released via:
    Creative Commons:
    with no guarantees. While the code has been cleaned up and usually commented helpfully, it has been written for certain purposes and has not been tested for every case.

    I also sometimes write here.

    (I apologize for the ads, I didn't realize they were there when selecting the theme.)

CQ_Using Custom DisplayPipeline

Custom Display

Solar analysis of Leshan topography As I’ve been working increasingly within Grasshopper, I’ve gotten more and more reluctant to go through convoluted workflows to produce and process images. The prospect of baking and rendering, processing and exporting a Make2D, distributing lineweights, compositing layers and adjusting color balance has become more offputting than it already was. … Continue reading


Slope Analysis

Steepest Paths down a Topography with Aggregate Runoff Tracing the steepest slopes over a topography has a common mapping exercise within Landscape Urbanism practices (and one which has been used productively by our students at EPFL). It makes for a good scripting exercise because there is really no good way to do it on the … Continue reading


Straight Skeleton (imperfect)

Straight Skeleton from HEM faces Inspired by a comment, this morning I played around with the idea of composing straight skeletons for the faces generated by the Half-Edge Mesh Definition posted earlier. A polygon’s straight skeleton resembles the voronoi skeleton or medial axis, but is composed of only straight segments (and typically fewer of them, … Continue reading


HEM functions

Offset, Distance, and Walk over Half-Edge Mesh Presented here are three functions for working with Half-Edge Meshes in Grasshopper. The first uses the lists of vertex’ incident edges (vIE) to calculate the bisecting angles at intersections in-between branches and create an offset of the graph which can be uniquely defined at every vertex (in black … Continue reading


Half-Edge Mesh

Each segment of this network has two half-edges Though the logic behind the data-structure of a half-edge mesh can be difficult or unintuitive to work with at first, once it becomes clear, it can become difficult to imagine working without recourse to functions that will tell you which face an edge is adjacent to, which … Continue reading


import OSM

OpenStreetMap data for Lausanne I was testing out the Elk plugin for Grasshopper some time ago (back when only the initial realease was available and found the ability to import data from OpenStreetMap incredibly useful. Not only is this an opensource database, but it’s global coverage is pretty thorough saving the trouble of trying … Continue reading


Face ID

Connecting moving points over a topographic model of Zermatt, Switzerland Following the previous post this code shows how to use the twin-edge function to more quickly identify a point position’s corresponding face from an HEM. In that code we simply checked through every face until finding one which intersected the cutting plane. In some ways … Continue reading


Mesh Section

Progressive sections through a topographic mesh of Zermatt, Switzerland This sketch adds to the Half-Edge Mesh sketch, a function sectionHEM() for cutting a planar section through a mesh. It also uses the Mesh Import function to instantiate the topography from a pair of .txt files (included in the .zip file below). The section function is … Continue reading


Medial Axis

The medial axes and vanes of various shapes One of the first grasshopper definitions shared at Daniel Piker‘s SpaceSymmetryStructure blog was a file for calculating the medial axis (or topological skeleton) of a curve: the set of points with at least two closest points on a curve boundary. This definition was more accurately a voronoi … Continue reading


Auxin Flux Canalisation

Each layer illustrates a change in step length Auxin Flux Canalisation is a an algorithmic process developed by Adam Runions at the University of Calgary Algoritmic Botany group to model the morphogenesis of leaf venation. The key to the process is a simulation of the distribution and flux of auxin -a plant hormone- whose distribution … Continue reading