166 lines
6.2 KiB
Markdown
166 lines
6.2 KiB
Markdown
# LibFile: titleBlock.scad
|
|
|
|
|
|
To use, add the following lines to the beginning of your file:
|
|
|
|
include <BOSL2/std.scad>;
|
|
include <Typography/typo.scad>;
|
|
include <titleBlock.scad>;
|
|
|
|
## File Contents
|
|
|
|
- [`A4_LANDSCAPE`](#constant-a4_landscape)
|
|
- [`titleBlock()`](#module-titleblock) – Generates a customizable title block layout for documents.
|
|
- [`A4`](#module-a4) – Generates an A4-sized boundary with configurable margins.
|
|
- [`plan`](#module-plan) – Generates a structured technical drawing layout with a title block.
|
|
|
|
|
|
### Constant: A4\_LANDSCAPE
|
|
|
|
**Description:**
|
|
|
|
A4 Page dimensions
|
|
|
|
---
|
|
|
|
### Module: titleBlock()
|
|
|
|
**Synopsis:** Generates a customizable title block layout for documents.
|
|
|
|
**Topics:** [Document Layout](Topics#document-layout), [Design](Topics#design), [Modularity](Topics#modularity)
|
|
|
|
**Description:**
|
|
|
|
This module creates a title block that includes a project title, description,
|
|
scale, revision, date, and other metadata. It supports full customization of
|
|
text size, positioning, and color. The title block is fully parametric,
|
|
allowing for flexible layout adjustments.
|
|
|
|
**Arguments:**
|
|
|
|
<abbr title="These args can be used by position or by name.">By Position</abbr> | What it does
|
|
-------------------- | ------------
|
|
`project` | The project name or title to be displayed. [default: undef]
|
|
`title` | The title text to display. [default: undef]
|
|
`description` | A description of the project or work. [default: ""]
|
|
`textSize` | The size of the text to be used in the title block. [default: 6]
|
|
`date` | The date associated with the project. [default: "2025-01-01"]
|
|
`scale` | The scale of the project (e.g., 1:10). [default: 1]
|
|
`revision` | The project revision or version. [default: "1a"]
|
|
`rect` | The width and height of the title block. [default: [90,30]]
|
|
`inset` | The inset (margin) around the title block content. [default: 2]
|
|
`anchor` | The anchor position for the title block. [default: CENTER]
|
|
`spin` | The rotation angle of the title block. [default: 0]
|
|
`orient` | The orientation of the title block. [default: UP]
|
|
`color` | The color of the title block text. [default: "Black"]
|
|
`strokeWidth` | The width of the title block's stroke. [default: 0.5]
|
|
`page` | The paper size (A4, etc.). [default: "A4"]
|
|
`landscape` | Whether the title block is in landscape orientation. [default: true]
|
|
|
|
**Example 1:** Title Block
|
|
|
|
<img align="left" alt="titleBlock() Example 1" src="images/titleBlock/titleblock.png" width="640" height="480">
|
|
|
|
<br clear="all" />
|
|
|
|
include <BOSL2/std.scad>;
|
|
include <Typography/typo.scad>;
|
|
include <titleBlock.scad>;
|
|
titleBlock(
|
|
project = "X-Drone",
|
|
title = "Engineering Design",
|
|
description = "This project focuses on designing a new type of drone for urban delivery services",
|
|
date = "2025-02-17",
|
|
revision = "A1",
|
|
scale = 20
|
|
);
|
|
|
|
---
|
|
|
|
### Module: A4
|
|
|
|
**Synopsis:** Generates an A4-sized boundary with configurable margins.
|
|
|
|
**Topics:** [Templates](Topics#templates), [Technical Drawings](Topics#technical-drawings)
|
|
|
|
**Usage:**
|
|
|
|
- A4(margin=15, landscape=false, onlyMargin=false);
|
|
|
|
**Description:**
|
|
|
|
This module defines an A4-sized boundary for technical drawings, with configurable
|
|
margins. It provides an optional outer frame and allows child objects to be placed
|
|
within the margin area. The module can be used for layout planning in OpenSCAD.
|
|
|
|
**Arguments:**
|
|
|
|
<abbr title="These args can be used by position or by name.">By Position</abbr> | What it does
|
|
-------------------- | ------------
|
|
`margin` | Margin size (default: 10).
|
|
`landscape` | Boolean flag to switch between landscape and portrait mode (default: true).
|
|
`onlyMargin` | If true, renders only the margin area; otherwise, includes the full frame (default: true).
|
|
`anchor` | Anchor position for alignment (default: CENTER).
|
|
`spin` | Rotation angle in degrees (default: 0).
|
|
`orient` | Orientation of the bounding box (default: UP).
|
|
`scale` | Scale factor (default: 1).
|
|
`strokeWidth` | Stroke width for the drawing boundary (default: 0.2).
|
|
|
|
**Example 1:** A4 with border and margin
|
|
|
|
<img align="left" alt="A4 Example 1" src="images/titleBlock/a4.png" width="640" height="480">
|
|
|
|
<br clear="all" />
|
|
|
|
include <BOSL2/std.scad>;
|
|
include <Typography/typo.scad>;
|
|
include <titleBlock.scad>;
|
|
A4( onlyMargin = false );
|
|
|
|
**Example 2:** A4 without border
|
|
|
|
<img align="left" alt="A4 Example 2" src="images/titleBlock/a4_2.png" width="640" height="480">
|
|
|
|
<br clear="all" />
|
|
|
|
include <BOSL2/std.scad>;
|
|
include <Typography/typo.scad>;
|
|
include <titleBlock.scad>;
|
|
A4( onlyMargin = true );
|
|
|
|
---
|
|
|
|
### Module: plan
|
|
|
|
**Synopsis:** Generates a structured technical drawing layout with a title block.
|
|
|
|
**Topics:** [Templates](Topics#templates), [Technical Drawings](Topics#technical-drawings)
|
|
|
|
**Usage:**
|
|
|
|
- plan("Project Alpha", title="Main Assembly", description="Assembly drawing", scale=2);
|
|
|
|
**Description:**
|
|
|
|
This module creates a structured layout for technical drawings. It includes a title block
|
|
positioned within an A4-sized frame, allowing child objects to be placed within the defined
|
|
margins. The layout is configurable to support different project details and orientations.
|
|
|
|
**Arguments:**
|
|
|
|
<abbr title="These args can be used by position or by name.">By Position</abbr> | What it does
|
|
-------------------- | ------------
|
|
`project` | Project name (required).
|
|
`title` | Title of the drawing (default: undef).
|
|
`description` | Short description of the drawing (default: "").
|
|
`textSize` | Size of the text in the title block (default: 6).
|
|
`date` | Date to be displayed in the title block (default: "2025-01-01").
|
|
`scale` | Scale factor for the drawing (default: 1).
|
|
`revision` | Revision identifier (default: "1a").
|
|
`page` | Page size identifier (default: "A4").
|
|
`margin` | Margin size around the drawing area (default: 10).
|
|
`orient` | Orientation of the drawing (default: UP).
|
|
|
|
---
|
|
|