Quotes/Readme.md

321 lines
10 KiB
Markdown

# Quotes - 0.9a
# Summary
The quotes.scad library is a dimensioning and annotation utility for OpenSCAD, primarily used for adding labeled dimension lines to models. It is built on the BOSL2 (Bryan OpenSCAD Library v2) framework, utilizing functions to enhance technical drawing capabilities within OpenSCAD.
[Quotes API](docs/quotes.scad.md)
The titleBlock.scad library defines a title block system for technical drawings, providing a standardized layout for project metadata such as title, description, date, scale, and revision number. The script is built on BOSL2 (Bryan OpenSCAD Library v2) and Typography/typo.scad for text rendering.
[Title Block API](docs/titleBlock.scad.md)
## Project Dependencies
To use these libraries in your OpenSCAD project:
1. Ensure that you have the libraries (BOSL2, Typography, and titleBlock) in your OpenSCAD library path or project folder.
2. Use the include directive to bring in the necessary files. For example:
```c
include <BOSL2/std.scad>;
include <Typography/typo.scad>;
include <titleBlock.scad>;
```
## Installation
...
# LibFile: quotes.scad
To use, add the following lines to the beginning of your file:
include <BOSL2/std.scad>;
include <quotes.scad>;
## File Contents
- [`quote()`](#module-quote) – Draws a dimension line with optional text labeling the length.
- [`arrowed_line()`](#module-arrowed_line) – Draws a straight line with arrowheads at both ends.
- [`ext_line()`](#module-ext_line) – Draws a straight extruded line between two points.
### Module: quote()
**Synopsis:** Draws a dimension line with optional text labeling the length.
**Topics:** [Dimensioning](Topics#dimensioning), [Annotation](Topics#annotation)
**Description:**
Creates a labeled dimension line with extension lines and an optional
length label. The dimension can be customized in terms of placement,
orientation, text formatting, and appearance.
**Arguments:**
<abbr title="These args can be used by position or by name.">By&nbsp;Position</abbr> | What it does
-------------------- | ------------
`length` | The length of the dimension line.
`textSize` | Size of the text label [default: 60].
`offsetFromOrigin` | Distance of the dimension line from the reference [default: textSize].
`extendBeyondDimLines` | Length beyond the extension lines [default: textSize / 5].
`textOffset` | Offset of the text from the dimension line [default: textSize / 3].
`color` | Color of the dimension line and text [default: "Red"].
`placement` | Position relative to the model (TOP or BOTTOM) [default: TOP].
`strokeWidth` | Thickness of the lines [default: 1].
`font` | Font used for text [default: "Saira Stencil One"].
`orient` | Text orientation (TOP or BOTTOM) [default: TOP].
`anchor` | Text alignment reference (CENTER, LEFT, RIGHT) [default: CENTER].
`spin` | Spin.
**Example 1:** Simple quote
<img align="left" alt="quote() Example 1" src="docs/images/quotes/quote.png" width="320" height="240">
include <BOSL2/std.scad>;
include <quotes.scad>;
quote(length=100, textSize=50);
<br clear="all" /><br/>
**Example 2:** Spin -90
<img align="left" alt="quote() Example 2" src="docs/images/quotes/quote_2.png" width="320" height="240">
include <BOSL2/std.scad>;
include <quotes.scad>;
quote(length=100, textSize=50,spin=-90);
<br clear="all" /><br/>
**Example 3:** Orient FRONT
<img align="left" alt="quote() Example 3" src="docs/images/quotes/quote_3.png" width="320" height="240">
include <BOSL2/std.scad>;
include <quotes.scad>;
quote(length=100, textSize=50,orient=FRONT);
<br clear="all" /><br/>
**Example 4:** Orient TOP
<img align="left" alt="quote() Example 4" src="docs/images/quotes/quote_4.png" width="320" height="240">
include <BOSL2/std.scad>;
include <quotes.scad>;
quote(length=100, orient=TOP);
<br clear="all" /><br/>
**Example 5:** offsetFromOrigin 20
<img align="left" alt="quote() Example 5" src="docs/images/quotes/quote_5.png" width="320" height="240">
include <BOSL2/std.scad>;
include <quotes.scad>;
quote(length=100, offsetFromOrigin=20);
<br clear="all" /><br/>
**Example 6:** extendBeyondDimLines 20
<img align="left" alt="quote() Example 6" src="docs/images/quotes/quote_6.png" width="320" height="240">
include <BOSL2/std.scad>;
include <quotes.scad>;
quote(length=100, extendBeyondDimLines=20);
<br clear="all" /><br/>
---
### Module: arrowed\_line()
**Synopsis:** Draws a straight line with arrowheads at both ends.
**Topics:** [Geometry](Topics#geometry), [Arrows](Topics#arrows), [Lines](Topics#lines)
**Description:**
Creates a linear extrusion representing a line with arrowheads at both ends.
The line thickness, length, and arrow size can be customized.
**Arguments:**
<abbr title="These args can be used by position or by name.">By&nbsp;Position</abbr> | What it does
-------------------- | ------------
`point1` | [x, y] start point of the line.
`point2` | [x, y] end point of the line.
`width` | Thickness of the line [default: 0.1].
`endcap_width` | Width of the arrowhead at each end [default: 15].
**Example 1:**
<img align="left" alt="arrowed\_line() Example 1" src="docs/images/quotes/arrowed_line.png" width="320" height="240">
include <BOSL2/std.scad>;
include <quotes.scad>;
arrowed_line([0,0], [50,50], width=0.5, endcap_width=5);
<br clear="all" /><br/>
---
### Module: ext\_line()
**Synopsis:** Draws a straight extruded line between two points.
**Topics:** [Geometry](Topics#geometry), [Lines](Topics#lines)
**Description:**
Creates a linear extrusion representing a straight line segment with a
specified width between two given points.
**Arguments:**
<abbr title="These args can be used by position or by name.">By&nbsp;Position</abbr> | What it does
-------------------- | ------------
`point1` | [x, y] start point of the line.
`point2` | [x, y] end point of the line.
`width` | Thickness of the line [default: 0.1].
**Example 1:**
<img align="left" alt="ext\_line() Example 1" src="docs/images/quotes/ext_line.png" width="320" height="240">
include <BOSL2/std.scad>;
include <quotes.scad>;
ext_line([0,0], [50,50], width=0.5);
<br clear="all" /><br/>
---
# Table of Contents
## List of Files
**Quotes:**
- [quotes.scad](#1-quotesscad) ([docs](quotes.scad))
Quotes,Dimensions
**TitleBlock:**
- [titleBlock.scad](#2-titleblockscad) ([docs](titleBlock.scad))
Title Block
## 1. [quotes.scad](quotes.scad)
Quotes,Dimensions
- [`quote()`](quotes.scad#module-quote) Mod – Draws a dimension line with optional text labeling the length.
- [`arrowed_line()`](quotes.scad#module-arrowed_line) Mod – Draws a straight line with arrowheads at both ends.
- [`ext_line()`](quotes.scad#module-ext_line) Mod – Draws a straight extruded line between two points.
## 2. [titleBlock.scad](titleBlock.scad)
Title Block
- [`A4_LANDSCAPE`](titleBlock.scad#constant-a4_landscape) Const
- [`titleBlock()`](titleBlock.scad#module-titleblock) Mod – Generates a customizable title block layout for documents.
- [`A4`](titleBlock.scad#module-a4) Mod – Generates an A4-sized boundary with configurable margins.
- [`plan`](titleBlock.scad#module-plan) Mod – Generates a structured technical drawing layout with a title block.
# Topic Index
An index of topics, with related functions, modules, and constants.
**A**: [Annotation](#annotation), [Arrows](#arrows)
**D**: [Design](#design), [Dimensioning](#dimensioning), [Document Layout](#document-layout)
**G**: [Geometry](#geometry)
**L**: [Lines](#lines)
**M**: [Modularity](#modularity)
**T**: [Technical Drawings](#technical-drawings), [Templates](#templates)
### Annotation
- [`quote()`](quotes.scad#module-quote) Mod – Draws a dimension line with optional text labeling the length.
### Arrows
- [`arrowed_line()`](quotes.scad#module-arrowed_line) Mod – Draws a straight line with arrowheads at both ends.
### Design
- [`titleBlock()`](titleBlock.scad#module-titleblock) Mod – Generates a customizable title block layout for documents.
### Dimensioning
- [`quote()`](quotes.scad#module-quote) Mod – Draws a dimension line with optional text labeling the length.
### Document Layout
- [`titleBlock()`](titleBlock.scad#module-titleblock) Mod – Generates a customizable title block layout for documents.
### Geometry
- [`arrowed_line()`](quotes.scad#module-arrowed_line) Mod – Draws a straight line with arrowheads at both ends.
- [`ext_line()`](quotes.scad#module-ext_line) Mod – Draws a straight extruded line between two points.
### Lines
- [`arrowed_line()`](quotes.scad#module-arrowed_line) Mod – Draws a straight line with arrowheads at both ends.
- [`ext_line()`](quotes.scad#module-ext_line) Mod – Draws a straight extruded line between two points.
### Modularity
- [`titleBlock()`](titleBlock.scad#module-titleblock) Mod – Generates a customizable title block layout for documents.
### Technical Drawings
- [`A4`](titleBlock.scad#module-a4) Mod – Generates an A4-sized boundary with configurable margins.
- [`plan`](titleBlock.scad#module-plan) Mod – Generates a structured technical drawing layout with a title block.
### Templates
- [`A4`](titleBlock.scad#module-a4) Mod – Generates an A4-sized boundary with configurable margins.
- [`plan`](titleBlock.scad#module-plan) Mod – Generates a structured technical drawing layout with a title block.
# Alphabetical Index
An index of Functions, Modules, and Constants by name.
[A](#a) [E](#e) [P](#p) [Q](#q) [T](#t)
## A
- [`A4`](titleBlock.scad#module-a4) Mod – Generates an A4-sized boundary with configurable margins.
- [`A4_LANDSCAPE`](titleBlock.scad#constant-a4_landscape) Const
- [`arrowed_line()`](quotes.scad#module-arrowed_line) Mod – Draws a straight line with arrowheads at both ends.
## E
- [`ext_line()`](quotes.scad#module-ext_line) Mod – Draws a straight extruded line between two points.
## P
- [`plan`](titleBlock.scad#module-plan) Mod – Generates a structured technical drawing layout with a title block.
## Q
- [`quote()`](quotes.scad#module-quote) Mod – Draws a dimension line with optional text labeling the length.
## T
- [`titleBlock()`](titleBlock.scad#module-titleblock) Mod – Generates a customizable title block layout for documents.