Building a TARDIS in Curv

This guide explains how to create a TARDIS model using the Curv language. We’ll go through each part of the TARDIS step-by-step, with detailed explanations of each command and keyword used in Curv.

Outline of the Project

  1. Install and Set Up Curv
  2. Define the Basic Dimensions and Parameters
  3. Create the Base and Walls of the TARDIS
  4. Add Windows and Doors
  5. Create Roof and Light Fixture
  6. Apply Detailing and Color

1. Install and Set Up Curv

To start, install Curv from https://curv3d.github.io/. Curv is a functional 3D modeling language that you can use on the command line or via the graphical interface.

2. Define the Basic Dimensions and Parameters

Curv allows defining variables for dimensions. We’ll use these to parameterize the TARDIS dimensions for scalability and flexibility.


// Set base dimensions
let width = 100;             // Width of the TARDIS base in mm
let height = 200;            // Total height of the TARDIS
let wall_thickness = 5;      // Wall thickness
let roof_height = 30;        // Height of the roof section
let door_height = 130;       // Door height
let window_height = 30;      // Window height

3. Create the Base and Walls of the TARDIS

In Curv, we create 3D shapes using built-in functions such as cube and difference. The cube function creates a rectangular prism, and the difference function allows us to create hollowed structures by subtracting shapes.


// Create the base structure of the TARDIS with walls
let base = difference(
    cube([width, width, height]),                // Outer box
    cube([width - 2 * wall_thickness, width - 2 * wall_thickness, height - wall_thickness])  // Hollowed interior
);

Explanation of Commands

4. Add Windows and Doors

We add windows and doors by creating cutouts on the walls using cube and difference functions to create holes for each part.

Windows


// Define the window dimensions and position
let window = difference(
    base,
    cube([20, 5, window_height]) * translate([40, width - wall_thickness, height / 2])
);

Explanation of Commands

Doors


// Define the door dimensions and position on the front face
let door = difference(
    base,
    cube([width / 4, 5, door_height]) * translate([width / 4, wall_thickness, 0])
);

Explanation of Commands

5. Create Roof and Light Fixture

The roof is represented by a scaled cube, while the light fixture is a sphere positioned on top of the roof. We use the scale and translate commands to position and resize each part.


// Create the pyramid-shaped roof
let roof = scale([1, 1, 0.3], cube([width, width, roof_height])) * translate([0, 0, height]);

// Add a light fixture on the top center of the roof
let light = sphere(5) * translate([0, 0, height + roof_height]);

Explanation of Commands

6. Apply Detailing and Color

In Curv, we can add color using material. Below, we set the colors for the base and the light fixture.


// Adding color
let tardis_base = material("plastic", "blue") * base;
let tardis_light = material("glass", "light") * light;

Explanation of Commands