Skip to content

Modelita is a domain-specific language (DSL) for creating 3D shapes through code. It provides a flexible approach to describing geometry, enabling users to generate 3D data with ease while keeping the system lightweight and simple.

License

Notifications You must be signed in to change notification settings

DanyMotilla/MODELITA

Repository files navigation

MODELITA v0.2 Documentation

Table of Contents

  1. Introduction
  2. Prerequisites
  3. Installation
  4. Using Modelita
  5. Command Reference
  6. Symbols
  7. Blender Integration

Introduction

MODELITA is a Domain-Specific Language (DSL) for 3D modeling, integrating Racket, PostGIS, and Blender. This documentation covers version 0.2.

Prerequisites

Before setting up MODELITA, ensure you have the following installed:

  1. Blender: Latest version from the official Blender website.

Installation

  1. Download and extract the package: modelita.tgz

Using Modelita

Once you have downloaded MODELITA, you can run the program from the terminal using ./modelita . When it starts , you will enter an interactive mode where you can input commands to create 3D shapes.

Command Reference

Movement Commands

Command Description
up Move cursor upward
down Move cursor downward
left Move cursor left
right Move cursor right
forward Move cursor forward
backward Move cursor backward

Rotation Commands

Command Description
rotate-x+ Rotate 90 degrees around X-axis (+)
rotate-x- Rotate 90 degrees around X-axis (-)
rotate-y+ Rotate 90 degrees around Y-axis (+)
rotate-y- Rotate 90 degrees around Y-axis (-)
rotate-z+ Rotate 90 degrees around Z-axis (+)
rotate-z- Rotate 90 degrees around Z-axis (-)

Shape Editing Commands

Command Description
a Add the current position as a vertex
b Clear the current shape
select Print the current cursor position
start Save the shape to an OBJ file

State Management Commands

Command Description
push Save current position and rotation
pop Restore last saved position/rotation

Symbols

Modelita allows you to define and save custom symbols (commands) to automate actions.

Define a Symbol

To define a new symbol:

define
Enter new symbol name: my-symbol
Enter commands (as list): (up right forward)

Symbol Management Commands

Command Description
save Save a symbol for later use
load Load a previously saved symbol

Example Usage:

; Save a symbol
save
Enter symbol name to save: my-symbol

; Load a saved symbol
load
Enter symbol filename to load: my-symbol

; Use a defined symbol
my-symbol

Blender Integration

Using the Blender OBJ Importer

The objimporter.py script automates importing OBJ files generated by Modelita into Blender.

Setup Steps:

  1. Your OBJ files are in the models/ directory
  2. Open Blender
  3. Load the Python script:
    • Open the Scripting tab
    • Click Text > Open and select objimporter.py
    • Change the path
    • Press Run Script
  4. Access the importer:
    • In the 3D View, press N to open the side panel
    • Go to the My Tools tab
    • Click Reload OBJ to import all files

Importer Features

Feature Description
Auto Cleanup Removes previous objects before import
Directory Scan Automatically finds OBJ files
Debug Info Shows import process details/errors

Note

The start command saves your shape design to an OBJ file, while the save command stores defined symbols. Keep this distinction in mind for effective use of Modelita.

About

Modelita is a domain-specific language (DSL) for creating 3D shapes through code. It provides a flexible approach to describing geometry, enabling users to generate 3D data with ease while keeping the system lightweight and simple.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published