Compare commits

1 Commits
master ... temp

Author SHA1 Message Date
sirlilpanda
726bbd469e temp 2026-07-13 17:38:03 +12:00
45 changed files with 16366785 additions and 89 deletions

View File

@@ -25,7 +25,8 @@ $fs = 0.01;
SCRIPT_VERSION="0.0.1";
// font for layout
FONT="Ubuntu Sans Mono:style=Regular";
// FONT="Ubuntu Sans Mono:style=Regular";
FONT="SquareFont:style=Regular";
// the test number ref number for this set of IDTs
test_number = 1;
@@ -49,7 +50,7 @@ c = 3992.0;
// c = 3159.0;
// the target frequency of the IDT
freq = 50.0e6;
freq = 10.0e6;
// the distance between the input and output IDT
// should be between 100-200
@@ -94,8 +95,8 @@ bond_pad_shape = "square";
// ================= text =================
info_block_offset_x=7;
info_block_offset_y=30;
render_text = true;
// total scale of infoblock
info_block_scale=0.3;

12
complie_presets.py Normal file
View File

@@ -0,0 +1,12 @@
from openscad import *
import os
idt = osuse("wafer_layouts/gird_array_idt.scad")
idt.render()
# if __name__ == "__main__":
# idt = BidirectionalIDTElectrode()

660200
dxfs/#multiple_freq_idt.dxf Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

328774
dxfs/multiple_freq_idt.dxf Normal file

File diff suppressed because it is too large Load Diff

84704
dxfs_new/#cross_25MHztext.dxf Normal file

File diff suppressed because it is too large Load Diff

105176
dxfs_new/#pair_10MHZtext.dxf Normal file

File diff suppressed because it is too large Load Diff

2476918
dxfs_new/array_345MHztext.dxf Normal file

File diff suppressed because it is too large Load Diff

41026
dxfs_new/cross_25MHztext.dxf Normal file

File diff suppressed because it is too large Load Diff

51262
dxfs_new/pair_10MHZtext.dxf Normal file

File diff suppressed because it is too large Load Diff

316198
dxfs_new/quadrand_50MHztext.dxf Normal file

File diff suppressed because it is too large Load Diff

28402
dxfs_new/single_10MHZtext.dxf Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,19 +1,27 @@
FILE_SUFFIX = "text"
# DXF_OUTPUT_PATH = "dxfs/"
DXF_OUTPUT_PATH = "dxfs_new"
all: single_10MHZ pair_10MHZ quadrand_50MHz array_345MHz cross_25MHz
single_10MHZ:
openscad -o dxfs/10MHz_single_IDT/single_10MHZ.dxf wafer_layouts/single_idt.scad -p dxfs/10MHz_single_IDT/single_idt.json
# openscad -o ${DXF_OUTPUT_PATH}/10MHz_single_IDT/single_10MHZ${FILE_SUFFIX}.dxf wafer_layouts/single_idt.scad -p dxfs/10MHz_single_IDT/single_idt.json
openscad -o ${DXF_OUTPUT_PATH}/single_10MHZ${FILE_SUFFIX}.dxf wafer_layouts/single_idt.scad -p dxfs/10MHz_single_IDT/single_idt.json
pair_10MHZ:
openscad -o dxfs/10MHz_pair_IDT/pair_10MHZ.dxf wafer_layouts/pair_idt.scad -p dxfs/10MHz_single_IDT/pair_idt.json
# openscad -o ${DXF_OUTPUT_PATH}/10MHz_pair_IDT/pair_10MHZ${FILE_SUFFIX}.dxf wafer_layouts/pair_idt.scad -p dxfs/10MHz_single_IDT/pair_idt.json
openscad -o ${DXF_OUTPUT_PATH}/pair_10MHZ${FILE_SUFFIX}.dxf wafer_layouts/pair_idt.scad -p dxfs/10MHz_single_IDT/pair_idt.json
quadrand_50MHz:
openscad -o dxfs/50MHz_quadrant_array_16/quadrand_50MHz.dxf wafer_layouts/quadrant_array.scad -p dxfs/50MHz_quadrant_array_16/quadrant_array_16_50MHz.json
# openscad -o ${DXF_OUTPUT_PATH}/50MHz_quadrant_array_16/quadrand_50MHz${FILE_SUFFIX}.dxf wafer_layouts/quadrant_array.scad -p dxfs/50MHz_quadrant_array_16/quadrant_array_16_50MHz.json
openscad -o ${DXF_OUTPUT_PATH}/quadrand_50MHz${FILE_SUFFIX}.dxf wafer_layouts/quadrant_array.scad -p dxfs/50MHz_quadrant_array_16/quadrant_array_16_50MHz.json
array_345MHz:
openscad -o dxfs/345MHz_grid_10_10_IDT/array_345MHz.dxf wafer_layouts/gird_array_idt.scad -p dxfs/345MHz_grid_10_10_IDT/gird_array_idt.json
# openscad -o ${DXF_OUTPUT_PATH}/345MHz_grid_10_10_IDT/array_345MHz${FILE_SUFFIX}.dxf wafer_layouts/gird_array_idt.scad -p dxfs/345MHz_grid_10_10_IDT/gird_array_idt.json
openscad -o ${DXF_OUTPUT_PATH}/array_345MHz${FILE_SUFFIX}.dxf wafer_layouts/gird_array_idt.scad -p dxfs/345MHz_grid_10_10_IDT/gird_array_idt.json
cross_25MHz:
openscad -o dxfs/25MHz_cross_idt/cross_25MHz.dxf wafer_layouts/cross_pattern_idt.scad -p dxfs/25MHz_cross_idt/cross_pattern_idt.json
# openscad -o ${DXF_OUTPUT_PATH}/25MHz_cross_idt/cross_25MHz${FILE_SUFFIX}.dxf wafer_layouts/cross_pattern_idt.scad -p dxfs/25MHz_cross_idt/cross_pattern_idt.json
openscad -o ${DXF_OUTPUT_PATH}/cross_25MHz${FILE_SUFFIX}.dxf wafer_layouts/cross_pattern_idt.scad -p dxfs/25MHz_cross_idt/cross_pattern_idt.json

View File

@@ -16,7 +16,8 @@ module bi_directional_idt(
// bond pad prams
has_bond_pads = false,
bond_pad_leg_length = 0.00005,
bond_pad_leg_width = 0.00001875,
bond_pad_leg_width = 0.00001875,
bond_pad_leg_width_overide = 0,
bond_pad_size = 0.000075,
bond_pad_angle = 45,
bond_pad_bond_pad_shape = "square",
@@ -29,7 +30,7 @@ module bi_directional_idt(
id_rot = [0, 0, 0],
// extra
post_scale = 1,
echo_stats = false,
echo_stats = true,
center = false
) {
@@ -38,7 +39,6 @@ module bi_directional_idt(
// dont worry about these magic fractions
length_of_input = n_fingers*lambda+1.74*lambda;
should_be_centered = center ? 1 : 0;
center_offset_y = length_of_input + distance * lambda/2;
center_offset_x = finger_length*lambda/2 + gap/2 + thickness;
@@ -72,14 +72,14 @@ module bi_directional_idt(
color([255/255, 255/255, 255/255]) {
bond_pad(
leg_length_tweak = lambda/4,
leg_width=c/f/4,
leg_width=(c/f/4*scale_unit)*(-bond_pad_leg_width_overide+1) + bond_pad_leg_width*bond_pad_leg_width_overide,
leg_length=length(
[0,0,0],
[bond_pad_leg_length, bond_pad_leg_length, 0]
[bond_pad_leg_length*scale_unit, bond_pad_leg_length*scale_unit, 0]
),
leg_angle = -bond_pad_angle,
size = bond_pad_size,
post_scale=scale_unit
size = bond_pad_size*scale_unit,
post_scale = 1
);
}
}
@@ -91,14 +91,14 @@ module bi_directional_idt(
if (has_bond_pads) {
bond_pad(
leg_length_tweak = lambda/5,
leg_width=c/f/4,
leg_width=(c/f/4*scale_unit)*(-bond_pad_leg_width_overide+1) + bond_pad_leg_width*bond_pad_leg_width_overide,
leg_length=length(
[0,0,0],
[bond_pad_leg_length, bond_pad_leg_length, 0]
[bond_pad_leg_length*scale_unit, bond_pad_leg_length*scale_unit, 0]
),
leg_angle = bond_pad_angle,
size = bond_pad_size,
post_scale=scale_unit
size = bond_pad_size*scale_unit,
post_scale = 1
);
}
}
@@ -110,14 +110,14 @@ module bi_directional_idt(
if (has_bond_pads) {
bond_pad(
leg_length_tweak = lambda/5,
leg_width=c/f/4,
leg_width=(c/f/4*scale_unit)*(-bond_pad_leg_width_overide+1) + bond_pad_leg_width*bond_pad_leg_width_overide,
leg_length=length(
[0,0,0],
[bond_pad_leg_length, bond_pad_leg_length, 0]
[bond_pad_leg_length*scale_unit, bond_pad_leg_length*scale_unit, 0]
),
leg_angle = bond_pad_angle,
size = bond_pad_size,
post_scale=scale_unit
size = bond_pad_size*scale_unit,
post_scale = 1
);
}
}
@@ -127,14 +127,14 @@ module bi_directional_idt(
if (has_bond_pads) {
bond_pad(
leg_length_tweak = lambda/4,
leg_width=c/f/4,
leg_width=(c/f/4*scale_unit)*(-bond_pad_leg_width_overide+1) + bond_pad_leg_width*bond_pad_leg_width_overide,
leg_length=length(
[0,0,0],
[bond_pad_leg_length, bond_pad_leg_length, 0]
[bond_pad_leg_length*scale_unit, bond_pad_leg_length*scale_unit, 0]
),
leg_angle = -bond_pad_angle,
size = bond_pad_size,
post_scale=scale_unit
size = bond_pad_size*scale_unit,
post_scale = 1
);
}
}

View File

@@ -8,8 +8,8 @@ module delay_line(
) {
// just a very small value that allows the polygons to overlap nicely
esp = $fs;
l45 =lambda*5/4;
esp = lambda/1000;
l45 = lambda*5/4;
l2 = lambda/2;
l4 = lambda/4;
l8 = lambda/8;

View File

@@ -2,10 +2,17 @@
// [TODO] try add the flat edge on to the wafer
module wafer(d) {
module wafer(d, exposure_size=3*25.4) {
if ($preview) {
color([128/255, 128/255, 128/255])
translate([0, 0, -1])
circle(r=d/2);
color([255/255, 128/255, 128/255, 50/255])
translate([0, 0, 3])
difference() {
circle(r=d/2);
circle(r=exposure_size/2);
}
}
}

948
openscad.pyi Normal file
View File

@@ -0,0 +1,948 @@
from typing import Union, Optional, overload
OpenSCADObjects = Union["OpenSCADObject", list["OpenSCADObject"]]
"""Type for functions that accept either a single OpenSCAD object or a list of objects."""
Color = Union[str, list[float]]
"""Color specification as either a color name string (e.g., "red") or RGB/RGBA values as [r, g, b] or [r, g, b, a]."""
Vector2 = list[float]
"""2D vector represented as [x, y] list."""
Vector3 = list[float]
"""3D vector represented as [x, y, z] list."""
Matrix4x4 = list[list[float]]
"""4x4 transformation matrix as a list of 4 lists of 4 floats."""
class OpenSCADObject:
"""Base class for OpenSCAD objects."""
origin: Matrix4x4
"""4x4 transformation matrix representing the object's origin.
Initialized as identity matrix."""
def translate(self, v: Vector3) -> "OpenSCADObject":
"""Translate this object.
Args:
v: Translation vector [x, y, z].
Returns:
The transformed object. The original object is unaffected.
"""
...
def rotate(
self, a: Union[float, Vector3], v: Optional[Vector3] = None
) -> "OpenSCADObject":
"""Rotate this object.
Args:
a: Rotation angle (degrees) or rotation vector [x, y, z].
v: Optional rotation axis vector when a is a scalar angle.
Returns:
The transformed object. The original object is unaffected.
"""
...
def scale(self, v: Union[float, Vector3]) -> "OpenSCADObject":
"""Scale this object.
Args:
v: Scale factor (uniform) or scale vector [x, y, z].
Returns:
The transformed object. The original object is unaffected.
"""
...
def mirror(self, v: Vector3) -> "OpenSCADObject":
"""Mirror this object.
Args:
v: Mirror plane normal vector [x, y, z].
Returns:
The transformed object. The original object is unaffected.
"""
...
def multmatrix(self, m: Matrix4x4) -> "OpenSCADObject":
"""Apply matrix transformation to this object.
Args:
m: 4x4 transformation matrix as a list of 4 lists of 4 floats.
Returns:
The transformed object. The original object is unaffected.
"""
...
def divmatrix(self, m: Matrix4x4) -> "OpenSCADObject":
"""Apply inverse matrix transformation to this object.
Args:
m: 4x4 matrix as a list of 4 lists of 4 floats for inverse transformation.
Returns:
The transformed object. The original object is unaffected.
"""
...
def offset(
self,
r: Optional[float] = None,
delta: Optional[float] = None,
chamfer: Optional[bool] = None,
fn: Optional[float] = None,
fa: Optional[float] = None,
fs: Optional[float] = None,
) -> "OpenSCADObject":
"""Offset this 2D object.
Args:
r: Offset radius (rounded corners).
delta: Offset distance (sharp corners).
chamfer: If True, creates chamfered corners.
fn: Number of fragments for curved parts.
fa: Minimum angle for each fragment.
fs: Minimum size for each fragment.
Returns:
The transformed object. The original object is unaffected.
"""
...
def color(self, c: Color, alpha: float = 1.0) -> "OpenSCADObject":
"""Color this object.
Args:
c: Color specification - color name string or RGB/RGBA values.
alpha: Alpha (transparency) value between 0.0 and 1.0. Defaults to 1.0.
Returns:
A new object with the color set. The original object is unaffected.
"""
...
def linear_extrude(
self,
height: Optional[float] = None,
convexity: int = 1,
center: Optional[bool] = None,
slices: int = 1,
segments: int = 0,
scale: Optional[Vector2] = None,
twist: Optional[float] = None,
fn: Optional[float] = None,
fa: Optional[float] = None,
fs: Optional[float] = None,
) -> "OpenSCADObject":
"""Linear extrude this 2D object to 3D.
Args:
height: Extrusion height.
convexity: Convexity parameter for rendering. Defaults to 1.
center: If True, centers the extrusion.
slices: Number of slices for twist/scale. Defaults to 1.
segments: Number of segments. Defaults to 0.
scale: Scale factor for top vs bottom.
twist: Twist angle in degrees.
fn: Number of fragments for curved parts.
fa: Minimum angle for each fragment.
fs: Minimum size for each fragment.
Returns:
A new object representing the result of the extrusion. The original object is unaffected.
"""
...
def rotate_extrude(
self,
convexity: int = 1,
angle: float = 360.0,
fn: Optional[float] = None,
fa: Optional[float] = None,
fs: Optional[float] = None,
) -> "OpenSCADObject":
"""Rotationally extrude this 2D object to 3D.
Args:
convexity: Convexity parameter for rendering. Defaults to 1.
angle: Rotation angle in degrees. Defaults to 360.0.
fn: Number of fragments for circle approximation.
fa: Minimum angle for each fragment.
fs: Minimum size for each fragment.
Returns:
A new object representing the result of the extrusion. The original object is unaffected.
"""
...
def resize(self, newsize: Vector3, convexity: int = 2) -> "OpenSCADObject":
"""Modifies the size of the object to match the given x,y, and z sizes.
Args:
newsize: New size dimensions as [x, y, z].
convexity: Convexity parameter for rendering. Defaults to 2.
Returns:
The transformed object. The original object is unaffected.
"""
...
def mesh(
self, triangulate: Optional[bool] = None
) -> Union[tuple[list[Vector3], list[list[int]]], list[list[Vector2]]]:
"""Export mesh representation of this object.
Args:
triangulate: If True, triangulates the mesh.
Returns:
For 3D objects: A tuple of (vertices, faces) where:
- vertices: List of 3D vertex coordinates [[x, y, z], ...]
- faces: List of face definitions (lists of vertex indices)
For 2D objects: A list of outlines where:
- Each outline is a list of 2D vertex coordinates [[x, y], ...]
"""
...
def align(
self, refmat: Matrix4x4, objmat: Optional[Matrix4x4] = None
) -> "OpenSCADObject":
"""Align this object to a reference matrix.
Args:
refmat: Reference transformation matrix.
objmat: Optional object transformation matrix.
Returns:
A new object. The original object is unaffected.
"""
...
def show(self) -> None:
"""Mark this object for output/display."""
...
def projection(
self, cut: Optional[bool] = None, convexity: int = 2
) -> "OpenSCADObject":
"""Create a 2D projection from this 3D object.
Args:
cut: If True, creates a cross-section at z=0.
convexity: Convexity parameter for rendering. Defaults to 2.
Returns:
The projected 2D object.
"""
...
def render(self, convexity: int = 2) -> "OpenSCADObject":
"""Force rendering this object.
Args:
convexity: Convexity parameter for rendering. Defaults to 2.
Returns:
The object that will be forced to render. The original object is unaffected.
"""
...
def union(self, *others: OpenSCADObjects) -> "OpenSCADObject":
"""Create a union of this object with others.
Args:
*others: Other OpenSCAD objects to union with this one.
Returns:
A new object representing the union. The original object is unaffected.
"""
...
def difference(self, *others: OpenSCADObjects) -> "OpenSCADObject":
"""Create a difference by subtracting others from this object.
Args:
*others: Other OpenSCAD objects to subtract from this one.
Returns:
A new object representing the difference. The original object is unaffected.
"""
...
def intersection(self, *others: OpenSCADObjects) -> "OpenSCADObject":
"""Create an intersection of this object with others.
Args:
*others: Other OpenSCAD objects to intersect with this one.
Returns:
A new object representing the intersection. The original object is unaffected.
"""
...
def __getattr__(self, name): ...
def __setattr__(self, name, value): ...
def __getitem__(self, name): ...
def __setitem__(self, name, value): ...
# Operators:
def __or__(self, other: OpenSCADObjects) -> "OpenSCADObject":
"""Create a union of two objects"""
...
def __and__(self, other: OpenSCADObjects) -> "OpenSCADObject":
"""Create an intersection of two objects"""
...
@overload
def __sub__(self, other: OpenSCADObjects) -> "OpenSCADObject":
"""Create a difference of two objects"""
...
def __add__(self, other: Vector3) -> "OpenSCADObject":
"""Create a new object by translating this object by a vector"""
...
@overload
def __sub__(self, other: Vector3) -> "OpenSCADObject":
"""Create a new object by translating this object by the negative of a vector"""
...
@overload
def __mul__(self, other: float) -> "OpenSCADObject":
"""Create a new object by scaling this object by a uniform factor in all directions"""
...
@overload
def __mul__(self, other: Vector3) -> "OpenSCADObject":
"""Create a new object by scaling this object by a vector of factors in [x, y, z] directions"""
...
def square(
dim: Optional[Union[float, list[float]]] = None, center: Optional[bool] = None
) -> OpenSCADObject:
"""Create a square primitive.
Args:
dim: Dimensions of the square. Can be a single number for a square,
or a sequence of 2 numbers [width, height] for a rectangle.
If not specified, creates a unit square.
center: If True, centers the square at the origin. If False or None,
places one corner at the origin. Defaults to False.
Returns:
A 2D geometric object.
"""
...
def circle(
r: Optional[float] = None,
d: Optional[float] = None,
fn: Optional[float] = None,
fa: Optional[float] = None,
fs: Optional[float] = None,
) -> OpenSCADObject:
"""Create a circle primitive.
Args:
r: Radius of the circle. Must be positive. Cannot be used with d.
If neither r nor d is specified, defaults to 1.
d: Diameter of the circle. Must be positive. Cannot be used with r.
fn: Number of fragments for circle approximation.
fa: Minimum angle for each fragment.
fs: Minimum size for each fragment.
Returns:
A 2D geometric object.
"""
...
def polygon(
points: Matrix4x4, paths: Optional[list[list[int]]] = None, convexity: int = 2
) -> OpenSCADObject:
"""Create a polygon primitive.
Args:
points: List of 2D coordinates defining the polygon vertices.
Each point must be a list of exactly 2 numbers [x, y].
Must contain at least one point.
paths: Optional list of paths, where each path is a list of indices
into the points list. If specified, must contain at least one path.
Used to define holes or complex polygons.
convexity: Convexity parameter for rendering optimization. Must be >= 1.
Defaults to 2.
Returns:
A 2D geometric object.
"""
...
def text(
text: str,
size: float = 1.0,
font: Optional[str] = None,
spacing: float = 1.0,
direction: str = "ltr",
language: str = "en",
script: str = "latin",
halign: str = "left",
valign: str = "baseline",``
fn: Optional[float] = None,
fa: Optional[float] = None,
fs: Optional[float] = None,
) -> OpenSCADObject:
"""Create a text primitive.
Args:
text: The text string to render.
size: Font size. Defaults to 1.0.
font: Font name to use. If None, uses default font.
spacing: Spacing between characters. Defaults to 1.0.
direction: Text direction, either "ltr" (left-to-right) or "rtl". Defaults to "ltr".
language: Language code (e.g., "en", "de"). Defaults to "en".
script: Script type (e.g., "latin", "arabic"). Defaults to "latin".
halign: Horizontal alignment: "left", "center", or "right". Defaults to "left".
valign: Vertical alignment: "baseline", "top", "center", or "bottom". Defaults to "baseline".
fn: Number of fragments for curved parts.
fa: Minimum angle for each fragment.
fs: Minimum size for each fragment.
Returns:
A 2D geometric object.
"""
...
def textmetrics(
text: str,
size: float = 1.0,
font: Optional[str] = None,
spacing: float = 1.0,
direction: str = "ltr",
language: str = "en",
script: str = "latin",
halign: str = "left",
valign: str = "baseline",
) -> dict[str, Union[float, list[float]]]:
"""Get text metrics for the given text parameters.
Args:
text: The text string to measure.
size: Font size. Defaults to 1.0.
font: Font name to use. If None, uses default font.
spacing: Spacing between characters. Defaults to 1.0.
direction: Text direction, either "ltr" or "rtl". Defaults to "ltr".
language: Language code (e.g., "en", "de"). Defaults to "en".
script: Script type (e.g., "latin", "arabic"). Defaults to "latin".
halign: Horizontal alignment: "left", "center", or "right". Defaults to "left".
valign: Vertical alignment: "baseline", "top", "center", or "bottom". Defaults to "baseline".
Returns:
A dictionary containing text metrics with keys:
- "ascent": Font ascent value
- "descent": Font descent value
- "offset": [x_offset, y_offset] list
- "advance": [advance_x, advance_y] list
- "position": [bbox_x, bbox_y] list
- "size": [bbox_width, bbox_height] list
"""
...
def cube(
size: Optional[Union[float, Vector3]] = None, center: Optional[bool] = None
) -> OpenSCADObject:
"""Create a cube primitive.
Args:
size: Dimensions of the cube. Can be a single number for a cube,
or a sequence of 3 numbers [x, y, z] for a rectangular box.
If not specified, creates a unit cube [1, 1, 1].
center: If True, centers the cube at the origin. If False or None,
places one corner at the origin. Defaults to False.
Returns:
A 3D geometric object.
"""
...
def cylinder(
h: Optional[float] = None,
r1: Optional[float] = None,
r2: Optional[float] = None,
center: Optional[bool] = None,
r: Optional[float] = None,
d: Optional[float] = None,
d1: Optional[float] = None,
d2: Optional[float] = None,
fn: Optional[float] = None,
fa: Optional[float] = None,
fs: Optional[float] = None,
) -> OpenSCADObject:
"""Create a cylinder primitive.
Args:
h: Height of the cylinder. Must be positive.
r1: Radius at bottom. Must be non-negative.
r2: Radius at top. Must be non-negative.
center: If True, centers the cylinder at the origin.
r: Uniform radius for both ends.
d: Uniform diameter for both ends.
d1: Diameter at bottom.
d2: Diameter at top.
fn: Number of fragments for circle approximation.
fa: Minimum angle for each fragment.
fs: Minimum size for each fragment.
Returns:
A 3D geometric object.
"""
...
def sphere(
r: Optional[float] = None,
d: Optional[float] = None,
fn: Optional[float] = None,
fa: Optional[float] = None,
fs: Optional[float] = None,
) -> OpenSCADObject:
"""Create a sphere primitive.
Args:
r: Radius of the sphere. Must be positive. Cannot be used with d.
d: Diameter of the sphere. Must be positive. Cannot be used with r.
fn: Number of fragments for sphere approximation.
fa: Minimum angle for each fragment.
fs: Minimum size for each fragment.
Returns:
A 3D geometric object.
"""
...
def polyhedron(
points: Matrix4x4,
faces: list[list[int]],
convexity: int = 2,
triangles: Optional[list[list[int]]] = None,
) -> OpenSCADObject:
"""Create a polyhedron primitive.
Args:
points: List of 3D coordinates defining the polyhedron vertices.
Each point must be a list of exactly 3 numbers [x, y, z].
Must contain at least one point.
faces: List of face definitions, where each face is a list of indices
into the points list.
convexity: Convexity parameter for rendering optimization. Defaults to 2.
triangles: Optional backwards compatibility parameter for triangular faces.
Returns:
A 3D geometric object.
"""
...
@overload
def translate(obj: OpenSCADObjects, v: Vector3) -> OpenSCADObject:
"""Translate an object or list of objects.
Args:
obj: Object or list of objects to translate.
v: Translation vector [x, y, z].
Returns:
The transformed object. The original object is unaffected.
"""
...
@overload
def translate(matrix: Matrix4x4, v: Vector3) -> Matrix4x4:
"""Apply translation to a 4x4 transformation matrix.
Args:
matrix: 4x4 transformation matrix to translate.
v: Translation vector [x, y, z].
Returns:
The transformed matrix with translation applied.
"""
...
@overload
def rotate(
obj: OpenSCADObjects, a: Union[float, Vector3], v: Optional[Vector3] = None
) -> OpenSCADObject:
"""Rotate an object or list of objects.
Args:
obj: Object or list of objects to rotate.
a: Rotation angle (degrees) or rotation vector [x, y, z].
v: Optional rotation axis vector when a is a scalar angle.
Returns:
The transformed object. The original object is unaffected.
"""
...
@overload
def rotate(
matrix: Matrix4x4, a: Union[float, Vector3], v: Optional[Vector3] = None
) -> Matrix4x4:
"""Apply rotation to a 4x4 transformation matrix.
Args:
matrix: 4x4 transformation matrix to rotate.
a: Rotation angle (degrees) or rotation vector [x, y, z].
v: Optional rotation axis vector when a is a scalar angle.
Returns:
The transformed matrix with rotation applied.
"""
...
@overload
def scale(obj: OpenSCADObjects, v: Union[float, Vector3]) -> OpenSCADObject:
"""Scale an object or list of objects.
Args:
obj: Object or list of objects to scale.
v: Scale factor (uniform) or scale vector [x, y, z].
Returns:
The transformed object. The original object is unaffected.
"""
...
@overload
def scale(matrix: Matrix4x4, v: Union[float, Vector3]) -> Matrix4x4:
"""Apply scaling to a 4x4 transformation matrix.
Args:
matrix: 4x4 transformation matrix to scale.
v: Scale factor (uniform) or scale vector [x, y, z].
Returns:
The transformed matrix with scaling applied.
"""
...
@overload
def mirror(obj: OpenSCADObjects, v: Vector3) -> OpenSCADObject:
"""Mirror an object or list of objects.
Args:
obj: Object or list of objects to mirror.
v: Mirror plane normal vector [x, y, z].
Returns:
The transformed object. The original object is unaffected.
"""
...
@overload
def mirror(matrix: Matrix4x4, v: Vector3) -> Matrix4x4:
"""Apply mirroring to a 4x4 transformation matrix.
Args:
matrix: 4x4 transformation matrix to mirror.
v: Mirror plane normal vector [x, y, z].
Returns:
The transformed matrix with mirroring applied.
"""
...
def multmatrix(obj: OpenSCADObjects, m: Matrix4x4) -> OpenSCADObject:
"""Apply matrix transformation to an object.
Args:
obj: Object to transform.
m: 4x4 transformation matrix as a list of 4 lists of 4 floats.
Returns:
The transformed object. The original object is unaffected.
"""
...
def color(obj: OpenSCADObjects, c: Color, alpha: float = 1.0) -> OpenSCADObject:
"""Color an object.
Args:
obj: Object to color.
c: Color specification - color name string or RGB/RGBA values.
alpha: Alpha (transparency) value between 0.0 and 1.0. Defaults to 1.0.
Returns:
A new object with the color set. The original object is unaffected.
"""
...
def union(*objects: OpenSCADObjects) -> OpenSCADObject:
"""Create a union of multiple objects.
Args:
*objects: Variable number of OpenSCAD objects or lists of objects to union.
Returns:
A new object representing the union. The original object is unaffected.
"""
...
def difference(*objects: OpenSCADObjects) -> OpenSCADObject:
"""Create a difference of multiple objects.
Args:
*objects: Variable number of OpenSCAD objects or lists of objects. The first object
has all subsequent objects subtracted from it.
Returns:
A new object representing the difference. The original object is unaffected.
"""
...
def intersection(*objects: OpenSCADObjects) -> OpenSCADObject:
"""Create an intersection of multiple objects.
Args:
*objects: Variable number of OpenSCAD objects or lists of objects to intersect.
Returns:
A new object representing the intersection. The original object is unaffected.
"""
...
def hull(*objects: OpenSCADObjects) -> OpenSCADObject:
"""Create a convex hull of multiple objects.
Args:
*objects: Variable number of OpenSCAD objects or lists of objects.
Returns:
A new object. The original object is unaffected.
"""
...
def linear_extrude(
obj: OpenSCADObjects,
height: Optional[float] = None,
convexity: int = 1,
center: Optional[bool] = None,
slices: int = 1,
segments: int = 0,
scale: Optional[Vector2] = None,
twist: Optional[float] = None,
fn: Optional[float] = None,
fa: Optional[float] = None,
fs: Optional[float] = None,
) -> OpenSCADObject:
"""Linear extrude a 2D object to 3D.
Args:
obj: 2D object to extrude.
height: Extrusion height.
convexity: Convexity parameter for rendering. Defaults to 1.
center: If True, centers the extrusion.
slices: Number of slices for twist/scale. Defaults to 1.
segments: Number of segments. Defaults to 0.
scale: Scale factor for top vs bottom.
twist: Twist angle in degrees.
fn: Number of fragments for curved parts.
fa: Minimum angle for each fragment.
fs: Minimum size for each fragment.
Returns:
The linearly extruded 3D object. The original object is unaffected.
"""
...
def rotate_extrude(
obj: OpenSCADObjects,
convexity: int = 1,
angle: float = 360.0,
fn: Optional[float] = None,
fa: Optional[float] = None,
fs: Optional[float] = None,
) -> OpenSCADObject:
"""Rotationally extrude a 2D object to 3D.
Args:
obj: 2D object to extrude.
convexity: Convexity parameter for rendering. Defaults to 1.
angle: Rotation angle in degrees. Defaults to 360.0.
fn: Number of fragments for circle approximation.
fa: Minimum angle for each fragment.
fs: Minimum size for each fragment.
Returns:
The rotationally extruded 3D object. The original object is unaffected.
"""
...
def offset(
obj: OpenSCADObjects,
r: Optional[float] = None,
delta: Optional[float] = None,
chamfer: Optional[bool] = None,
fn: Optional[float] = None,
fa: Optional[float] = None,
fs: Optional[float] = None,
) -> OpenSCADObject:
"""Offset a 2D object.
Args:
obj: 2D object to offset.
r: Offset radius (rounded corners).
delta: Offset distance (sharp corners).
chamfer: If True, creates chamfered corners.
fn: Number of fragments for curved parts.
fa: Minimum angle for each fragment.
fs: Minimum size for each fragment.
Returns:
The offset 2D object. The original object is unaffected.
"""
...
def minkowski(*objects: OpenSCADObjects, convexity: int = 2) -> OpenSCADObject:
"""Create a Minkowski sum of objects.
Args:
*objects: Objects or lists of objects to compute Minkowski sum of.
convexity: Convexity parameter for rendering. Defaults to 2.
Returns:
A new object representing the Minkowski sum. The original object is unaffected.
"""
...
def projection(
obj: OpenSCADObjects, cut: Optional[bool] = None, convexity: int = 2
) -> OpenSCADObject:
"""Create a 2D projection from a 3D object.
Args:
obj: 3D object to project.
cut: If True, creates a cross-section at z=0.
convexity: Convexity parameter for rendering. Defaults to 2.
Returns:
The projected 2D object.
"""
...
def surface(
file: str,
center: Optional[bool] = None,
convexity: int = 2,
invert: Optional[bool] = None,
) -> OpenSCADObject:
"""Create a surface from a heightmap file.
Args:
file: Path to the heightmap image file.
center: If True, centers the surface.
convexity: Convexity parameter for rendering. Defaults to 2.
invert: If True, inverts the heightmap.
Returns:
A 3d object generated from the imported height map.
"""
...
def show(obj: OpenSCADObjects) -> None:
"""Mark an object for output/display.
Args:
obj: Object to mark for output.
"""
...
def render(obj: OpenSCADObjects, convexity: int = 2) -> OpenSCADObject:
"""Force rendering an object.
Args:
obj: Object to render.
convexity: Convexity parameter for rendering. Defaults to 2.
Returns:
The object that will be forced to render. The original object is unaffected.
"""
...
def resize(
obj: OpenSCADObjects, newsize: Vector3, convexity: int = 2
) -> OpenSCADObject:
"""Modifies the size of an object to match the given x,y, and z sizes.
Args:
obj: Object to resize.
newsize: New size dimensions as [x, y, z].
convexity: Convexity parameter for rendering. Defaults to 2.
Returns:
The resized object. The original object is unaffected.
"""
...
def divmatrix(obj: OpenSCADObjects, m: Matrix4x4) -> OpenSCADObject:
"""Apply inverse matrix transformation to an object.
Args:
obj: Object to transform.
m: 4x4 matrix as a list of 4 lists of 4 floats for inverse transformation.
Returns:
The inverse transformed object.
"""
...
def fill(*objects: OpenSCADObjects) -> OpenSCADObject:
"""Create a fill operation on objects.
Args:
*objects: Variable number of OpenSCAD objects or lists of objects to fill.
Returns:
A new object representing the fill operation result. The original object is unaffected.
"""
...
def mesh(
obj: OpenSCADObjects, triangulate: Optional[bool] = None
) -> Union[tuple[list[Vector3], list[list[int]]], list[list[Vector2]]]:
"""Export mesh representation of an object.
Args:
obj: Object to convert to mesh.
triangulate: If True, triangulates the mesh.
Returns:
For 3D objects: A tuple of (vertices, faces) where:
- vertices: List of 3D vertex coordinates [[x, y, z], ...]
- faces: List of face definitions (lists of vertex indices)
For 2D objects: A list of outlines where:
- Each outline is a list of 2D vertex coordinates [[x, y], ...]
"""
...
def align(
obj: OpenSCADObjects, refmat: Matrix4x4, objmat: Optional[Matrix4x4] = None
) -> OpenSCADObject:
"""Align an object to a reference matrix.
Args:
obj: Object to align.
refmat: Reference transformation matrix.
objmat: Optional object transformation matrix.
Returns:
A new object after alignment. The original object is unaffected.
"""
...

70
temp.dxf Normal file
View File

@@ -0,0 +1,70 @@
0
SECTION
2
BLOCKS
0
ENDSEC
0
SECTION
2
ENTITIES
0
LINE
8
0
10
-5
20
-5
11
5
21
-5
0
LINE
8
0
10
5
20
-5
11
5
21
5
0
LINE
8
0
10
5
20
5
11
-5
21
5
0
LINE
8
0
10
-5
20
5
11
-5
21
-5
0
ENDSEC
0
SECTION
2
OBJECTS
0
DICTIONARY
0
ENDSEC
0
EOF

1
temp.scad Normal file
View File

@@ -0,0 +1 @@
square(10, center=true);

View File

@@ -23,7 +23,8 @@ $fs = 0.01;
// ================= meta =================
SCRIPT_VERSION="0.0.1";
// this really just need to be any mon font
FONT="Ubuntu Sans Mono:style=Regular";
// FONT="Ubuntu Sans Mono:style=Regular";
FONT="SquareFont:style=Regular";
test_number = 1;
// scale in m
scale_unit = 1e3;
@@ -73,6 +74,7 @@ info_block_scale=0.3;
title_text_size = 4;
prop_text_size = 2.5;
id_text_size = 1;
render_text = true;
// ================= text =================
// ================= IDT Pos =================
@@ -103,13 +105,16 @@ module params() {
str("size : ", size),
str("feat. size (mm): ", (c/freq)*1e3 / 4),
str("version : ", SCRIPT_VERSION)
]
],
font=FONT
);
}
translate([info_block_offset_x, -info_block_offset_y, 0])
scale([info_block_scale, info_block_scale, info_block_scale])
params();
if (render_text) {
translate([info_block_offset_x, -info_block_offset_y, 0])
scale([info_block_scale, info_block_scale, info_block_scale])
params();
}
wafer(wafer_size_inch*25.4);

View File

@@ -29,7 +29,8 @@ $fs = 0.01;
SCRIPT_VERSION="0.0.1";
// font for layout
FONT="Ubuntu Sans Mono:style=Regular";
FONT="SquareFont:style=Regular";
// FONT="Ubuntu Sans Mono:style=Regular";
// the test number ref number for this set of IDTs
test_number = 1;
@@ -81,7 +82,7 @@ has_id_number = true;
leg_length = 0.001;
// the width of the leg
leg_width = 0.00001875;
leg_width = 0.001875;
// the angle the leg comes off from the IDT,
// positive angle means the leg is angled away
@@ -112,6 +113,8 @@ prop_text_size = 2.5;
// the size of the ID numbers in on the IDTS
id_text_size = 0.5;
render_text = true;
// ================= text =================
// ================= wafers =================
@@ -122,7 +125,7 @@ wafer_size_inch = 4;
// ================= # IDTS =================
rows = 10;
cols = 10;
cols = 7;
spacing_x = 4;
spacing_y = 7;
@@ -145,15 +148,19 @@ module params() {
str("size : ", size),
str("feat. size (mm): ", (c/freq)*1e3 / 4),
str("version : ", SCRIPT_VERSION)
]
],
font=FONT
);
}
translate([info_block_offset_x, -info_block_offset_y, 0])
scale([info_block_scale, info_block_scale, info_block_scale])
params();
if (render_text) {
translate([info_block_offset_x, -info_block_offset_y, 0])
scale([info_block_scale, info_block_scale, info_block_scale])
params();
}
wafer(4*0.0254*scale_unit);

View File

@@ -1,6 +1,7 @@
include <../modules/bidirectional_idt.scad>
include <../modules/parameter_text.scad>
include <../modules/wafer.scad>
include <../common_paramas.scad>
// ================= README =================
// these are the normal parameters used by
@@ -23,7 +24,8 @@ $fs = 0.01;
// ================= meta =================
SCRIPT_VERSION="0.0.1";
// this really just need to be any mon font
FONT="Ubuntu Sans Mono:style=Regular";
// FONT="Ubuntu Sans Mono:style=Regular";
FONT="SquareFont:style=Regular";
test_number = 1;
// scale in m
scale_unit = 1e3;
@@ -76,6 +78,7 @@ info_block_scale=0.3;
title_text_size = 4;
prop_text_size = 2.5;
id_text_size = 1;
render_text = true;
// ================= text =================
@@ -107,13 +110,17 @@ module params() {
str("size : ", size),
str("feat. size (mm): ", (c/freq)*1e3 / 4),
str("version : ", SCRIPT_VERSION)
]
],
font=FONT
);
}
translate([info_block_offset_x, -info_block_offset_y, 0])
scale([info_block_scale, info_block_scale, info_block_scale])
params();
if (render_text) {
translate([info_block_offset_x, -info_block_offset_y, 0])
scale([info_block_scale, info_block_scale, info_block_scale])
params();
}
wafer(wafer_size_inch*25.4);

View File

@@ -0,0 +1,427 @@
include <../modules/bidirectional_idt.scad>
include <../modules/parameter_text.scad>
include <../modules/wafer.scad>
include <../common_paramas.scad>
// ================= README =================
// these are the normal parameters used by
// each one of the layout scripts
// however they do dont directly use them
// and instead have thier own copy
//
// this was done in order to have more control
// over each of the scripts themsevels
// allowing each to have even more parameters
// and having them show up in the open scad
// parameters window
// ================= README =================
// ================= openscad prams =================
$fa = 1;
$fs = 0.01;
// ================= openscad prams =================
// ================= meta =================
SCRIPT_VERSION="0.0.1";
// this really just need to be any mon font
// FONT="Ubuntu Sans Mono:style=Regular";
FONT="SquareFont:style=Regular";
test_number = 1;
// scale in m
scale_unit = 1e3;
// ================= meta =================
// ================= IDT =================
substrate = "LINBO";
// linbo
c = 3992.0;
// si
// c = 3159.0;
// $fs = (c/freq);
// inout distance
distance = 150;
// number of finger
n_fingers = 50;
// should be 50-70
finger_length = 60;
// for tweaking the design
gap = 0;
// for tweaking the design
thickness = 0;
has_id_number = false;
// ================= IDT =================
// ================= bond pad =================
leg_length = 0.003;
leg_width = 0.00001875;
leg_angle = 10;
size = 0.002;
bond_pad_shape = "square";
// ================= bond pad =================
// ================= text =================
info_block_offset_x=20;
info_block_offset_y=-30;
info_block_scale=0.3;
title_text_size = 4;
prop_text_size = 2.5;
id_text_size = 1;
render_text = true;
// ================= text =================
// ================= IDT Pos =================
idt_1_x_offset = 0;
idt_1_y_offset = 0;
idt_2_x_offset = 0;
idt_2_y_offset = 0;
// ================= IDT Pos =================
// ================= wafers =================
wafer_size_inch = 4;
// ================= wafers =================
// module params() {
// parameter_text(
// str("IDT ", substrate, "#", test_number),
// [
// str("c (ms): ", c),
// str("freq (Hz): ", freq),
// str("distance : ", distance),
// str("n_fingers : ", n_fingers),
// str("finger_length : ", finger_length),
// str("gap : ", gap),
// str("thickness : ", thickness),
// str("leg_length : ", leg_length),
// str("leg_angle : ", leg_angle),
// str("size : ", size),
// str("feat. size (mm): ", (c/freq)*1e3 / 4),
// str("version : ", SCRIPT_VERSION)
// ],
// font=FONT
// );
// }
// if (render_text) {
// translate([info_block_offset_x, -info_block_offset_y, 0])
// scale([info_block_scale, info_block_scale, info_block_scale])
// params();
// }
wafer(wafer_size_inch*25.4);
freq_1 = 345.0e6;
idt_1_x = 10; // [-50:50]
idt_1_y = 26.5; // [-50:50]
translate([idt_1_x, idt_1_y, 0])
for (i=[0:2]) {
translate([4*i, 0, 0])
bi_directional_idt(
c,
freq_1,
n_fingers,
distance,
finger_length,
gap,
0.1,
post_scale=scale_unit,
has_bond_pads = true,
bond_pad_angle = 25,
bond_pad_leg_length = 0.001,
bond_pad_leg_width = 0.03,
bond_pad_leg_width_overide = 1,
bond_pad_size = 0.0005,
has_id = has_id_number,
center = true
);
}
translate([10, 20, 0])
for (i=[0:2]) {
translate([4*i, 0, 0])
bi_directional_idt(
c,
freq_1,
n_fingers,
distance,
finger_length,
gap,
0.1,
post_scale=scale_unit,
has_bond_pads = true,
bond_pad_angle = 25,
bond_pad_leg_width = 0.03,
bond_pad_leg_width_overide = 1,
bond_pad_leg_length = 0.001,
bond_pad_size = 0.0005,
has_id = has_id_number,
center = true
);
}
translate([10, 13.5, 0])
for (i=[0:2]) {
translate([4*i, 0, 0])
bi_directional_idt(
c,
freq_1,
n_fingers,
distance,
finger_length,
gap,
0.1,
post_scale=scale_unit,
has_bond_pads = true,
bond_pad_angle = 25,
bond_pad_leg_width = 0.03,
bond_pad_leg_width_overide = 1,
bond_pad_leg_length = 0.001,
bond_pad_size = 0.0005,
has_id = has_id_number,
center = true
);
}
freq_2 = 50.0e6;
idt_2_x = 0;
idt_2_y = 0;
translate([-7, 20, 0])
for (i=[0:2]) {
translate([6*i, 0, 0])
bi_directional_idt(
c,
freq_2,
n_fingers,
100,
30,
gap,
0.1,
post_scale=scale_unit,
has_bond_pads = true,
bond_pad_angle = 25,
bond_pad_leg_width = 0.03,
bond_pad_leg_width_overide = 1,
bond_pad_leg_length = 0.001,
bond_pad_size = 0.0005,
has_id = has_id_number,
center = true
);
}
freq_3 = 100.0e6;
idt_3_x = 0;
idt_3_y = 0;
translate([-22, 10, 0])
for (i=[0:2]) {
translate([5*i, 0, 0])
bi_directional_idt(
c,
freq_3,
n_fingers,
100,
30,
gap,
0.1,
post_scale=scale_unit,
has_bond_pads = true,
bond_pad_angle = 25,
bond_pad_leg_width = 0.03,
bond_pad_leg_width_overide = 1,
bond_pad_leg_length = 0.001,
bond_pad_size = 0.0005,
has_id = has_id_number,
center = true
);
}
translate([-22, 22, 0])
for (i=[0:2]) {
translate([5*i, 0, 0])
bi_directional_idt(
c,
freq_3,
n_fingers,
100,
30,
gap,
0.1,
post_scale=scale_unit,
has_bond_pads = true,
bond_pad_angle = 25,
bond_pad_leg_width = 0.03,
bond_pad_leg_width_overide = 1,
bond_pad_leg_length = 0.001,
bond_pad_size = 0.0005,
has_id = has_id_number,
center = true
);
}
freq_4 = 250.0e6;
idt_4_x = 0;
idt_4_y = 0;
translate([-21, 0, 0])
for (i=[0:2]) {
translate([4*i, 0, 0])
bi_directional_idt(
c,
freq_4,
n_fingers,
100,
50,
gap,
0.1,
post_scale=scale_unit,
has_bond_pads = true,
bond_pad_angle = 25,
bond_pad_leg_width = 0.03,
bond_pad_leg_width_overide = 1,
bond_pad_leg_length = 0.001,
bond_pad_size = 0.0005,
has_id = has_id_number,
center = true
);
}
translate([-21, -7, 0])
for (i=[0:2]) {
translate([4*i, 0, 0])
bi_directional_idt(
c,
freq_4,
n_fingers,
100,
50,
gap,
0.1,
post_scale=scale_unit,
has_bond_pads = true,
bond_pad_angle = 25,
bond_pad_leg_width = 0.03,
bond_pad_leg_width_overide = 1,
bond_pad_leg_length = 0.001,
bond_pad_size = 0.0005,
has_id = has_id_number,
center = true
);
}
translate([-21, -14, 0])
for (i=[0:2]) {
translate([4*i, 0, 0])
bi_directional_idt(
c,
freq_4,
n_fingers,
100,
50,
gap,
0.1,
post_scale=scale_unit,
has_bond_pads = true,
bond_pad_angle = 25,
bond_pad_leg_width = 0.03,
bond_pad_leg_width_overide = 1,
bond_pad_leg_length = 0.001,
bond_pad_size = 0.0005,
has_id = has_id_number,
center = true
);
}
freq_5 = 20.0e6;
idt_5_x = 0;
idt_5_y = 0;
translate([-4, -5, 0])
for (i=[0:2]) {
translate([9*i, 0, 0])
bi_directional_idt(
c,
freq_5,
20,
75,
20,
gap,
0.1,
post_scale=scale_unit,
has_bond_pads = true,
bond_pad_angle = 25,
bond_pad_leg_width = leg_width,
bond_pad_leg_length = 0.001,
bond_pad_size = 0.0005,
has_id = has_id_number,
center = true
);
}
echo("============================ 10MHz ============================");
echo("============================ 10MHz ============================");
echo("============================ 10MHz ============================");
echo("============================ 10MHz ============================");
echo("============================ 10MHz ============================");
freq_6 = 10.0e6;
idt_6_x = 0;
idt_6_y = 0;
translate([-30, 0, 0])
bi_directional_idt(
c,
freq_6,
10,
40,
10,
gap,
0.1,
post_scale=scale_unit,
has_bond_pads = true,
bond_pad_angle = 25,
bond_pad_leg_width = leg_width,
bond_pad_leg_length = 0.001,
bond_pad_size = 0.0005,
has_id = has_id_number,
center = true
);
translate([+31, 0, 0])
bi_directional_idt(
c,
freq_6,
10,
40,
10,
gap,
0.1,
post_scale=scale_unit,
has_bond_pads = true,
bond_pad_angle = 25,
bond_pad_leg_width = leg_width,
bond_pad_leg_length = 0.001,
bond_pad_size = 0.0005,
has_id = has_id_number,
center = true
);
translate([+23.5, 0, 0])
bi_directional_idt(
c,
freq_6,
10,
40,
10,
gap,
0.1,
post_scale=scale_unit,
has_bond_pads = true,
bond_pad_angle = 25,
bond_pad_leg_width = leg_width,
bond_pad_leg_length = 0.001,
bond_pad_size = 0.0005,
has_id = has_id_number,
center = true
);

View File

@@ -23,7 +23,8 @@ $fs = 0.01;
// ================= meta =================
SCRIPT_VERSION="0.0.1";
// this really just need to be any mon font
FONT="Ubuntu Sans Mono:style=Regular";
// FONT="Ubuntu Sans Mono:style=Regular";
FONT="SquareFont:style=Regular";
test_number = 1;
// scale in m
@@ -40,12 +41,14 @@ substrate = "LINBO";
c = 3992.0;
// si
// c = 3159.0;
freq = 10.0e6;
// AlN
// c = 5800.0;
freq = 100.0e6;
// $fs = (c/freq);
// inout distance
distance = 70;
distance = 200;
// number of finger
n_fingers = 50;
@@ -77,6 +80,7 @@ info_block_scale=0.3;
title_text_size = 4;
prop_text_size = 2.5;
id_text_size = 1;
render_text = true;
// ================= text =================
// ================= IDT Pos =================
@@ -107,13 +111,17 @@ module params() {
str("size : ", size),
str("feat. size (mm): ", (c/freq)*1e3 / 4),
str("version : ", SCRIPT_VERSION)
]
],
font=FONT
);
}
translate([info_block_offset_x, -info_block_offset_y, 0])
scale([info_block_scale, info_block_scale, info_block_scale])
params();
if (render_text) {
translate([info_block_offset_x, -info_block_offset_y, 0])
scale([info_block_scale, info_block_scale, info_block_scale])
params();
}
wafer(wafer_size_inch*25.4);

View File

@@ -12,7 +12,8 @@ $fs = 0.01;
// ================= meta =================
SCRIPT_VERSION="0.0.1";
// this really just need to be any mon font
FONT="Ubuntu Sans Mono:style=Regular";
// FONT="Ubuntu Sans Mono:style=Regular";
FONT="SquareFont:style=Regular";
test_number = 1;
// scale in m
scale_unit = 1e3;
@@ -56,6 +57,7 @@ bond_pad_shape = "square";
// ================= bond pad =================
// ================= text =================
render_text = true;
info_block_offset_x=7;
info_block_offset_y=30;
info_block_scale=0.3;
@@ -75,6 +77,8 @@ idt_y_spacing = 12.5;
wafer_size_inch = 4;
// ================= wafers =================
module params() {
parameter_text(
str("IDT ", substrate, "#", test_number),
@@ -91,18 +95,20 @@ module params() {
str("size : ", size),
str("feat. size (mm): ", (c/freq)*1e3 / 4),
str("version : ", SCRIPT_VERSION)
]
],
font=FONT
);
}
translate([info_block_offset_x, -info_block_offset_y, 0]) {
rotate([0, 0, -90])
scale([info_block_scale, info_block_scale, info_block_scale]) {
if (render_text) {
translate([info_block_offset_x, -info_block_offset_y, 0])
scale([info_block_scale, info_block_scale, info_block_scale])
params();
}
}
rotate([0, 0, 180])
translate([info_block_offset_x, -info_block_offset_y, 0]) {

View File

@@ -1,6 +1,7 @@
include <../modules/bidirectional_idt.scad>
include <../modules/parameter_text.scad>
include <../modules/wafer.scad>
include <../common_paramas.scad>
// ================= README =================
// these are the normal parameters used by
@@ -15,7 +16,6 @@ include <../modules/wafer.scad>
// parameters window
// ================= README =================
// ================= openscad prams =================
// min angle
@@ -30,7 +30,8 @@ $fs = 0.01;
SCRIPT_VERSION="0.0.1";
// font for layout
FONT="Ubuntu Sans Mono:style=Regular";
// FONT="Ubuntu Sans Mono:style=Regular";
FONT="SquareFont:style=Regular";
// the test number ref number for this set of IDTs
test_number = 1;
@@ -41,19 +42,20 @@ scale_unit = 1e3;
// ================= meta =================
// ================= IDT =================
// the underlying substrate
substrate = "SI";
// linbo
// the acoustic wave speed in the substrate
c = 3992.0;
// the aoucstice wave speed in the substrate
// c = 3992.0;
// si
// c = 3159.0;
c = 3159.0;
// the target frequency of the IDT
freq = 10.0e6;
freq = 17.0e8;
// the distance between the input and output IDT
// should be between 100-200
@@ -63,7 +65,7 @@ distance = 50;
n_fingers = 50;
// the length of the figure or aperture should be 50-70
finger_length = 50;
finger_length = 60;
// the gap between both sides of the IDT (should be used for tweaking)
gap = 0;
@@ -98,8 +100,8 @@ bond_pad_shape = "square";
// ================= text =================
info_block_offset_x=25;
info_block_offset_y=10;
render_text = true;
// total scale of infoblock
info_block_scale=0.3;
@@ -120,7 +122,6 @@ wafer_size_inch = 4;
// ================= wafers =================
// ================= IDT Pos =================
// the x offset of the IDT from the center
@@ -128,31 +129,37 @@ idt_x_offset = 0;
// the y offset of the IDT from the center
idt_y_offset = 0;
info_block_offset_x=25;
info_block_offset_y=-7;
// ================= IDT Pos =================
module params() {
parameter_text(
str("IDT ", substrate, "#", test_number),
[
str("c (ms): ", c),
str("freq (Hz): ", freq),
str("distance : ", distance),
str("n_fingers : ", n_fingers),
str("finger_length : ", finger_length),
str("gap : ", gap),
str("thickness : ", thickness),
str("leg_length : ", leg_length),
str("leg_angle : ", leg_angle),
str("size : ", size),
str("feat. size (mm): ", (c/freq)*1e3 / 4),
str("version : ", SCRIPT_VERSION)
]
str("C: ", c),
str("FREQ: ", freq),
str("DISTANCE: ", distance),
str("N_FINGERS: ", n_fingers),
str("FINGER_LENGTH: ", finger_length),
str("GAP: ", gap),
str("THICKNESS: ", thickness),
str("LEG_LENGTH: ", leg_length),
str("LEG_ANGLE: ", leg_angle),
str("SIZE: ", size),
str("FEAT. SIZE: ", (c/freq)*1e3 / 4),
str("VERSION: ", SCRIPT_VERSION)
],
font=FONT
);
}
translate([info_block_offset_x, -info_block_offset_y, 0])
scale([info_block_scale, info_block_scale, info_block_scale])
params();
if (render_text) {
translate([info_block_offset_x, -info_block_offset_y, 0])
scale([info_block_scale, info_block_scale, info_block_scale])
params();
}
wafer(wafer_size_inch*25.4);
@@ -173,4 +180,124 @@ bi_directional_idt(
bond_pad_size = size,
center = true,
echo_stats = true
);
);
// // ================= README =================
// // these are the normal parameters used by
// // each one of the layout scripts
// // however they do dont directly use them
// // and instead have thier own copy
// //
// // this was done in order to have more control
// // over each of the scripts themsevels
// // allowing each to have even more parameters
// // and having them show up in the open scad
// // parameters window
// // ================= README =================
// // ================= openscad prams =================
// // min angle
// $fa = 25;
// // min size
// $fs = 0.1;
// // ================= openscad prams =================
// // ================= meta =================
// // version number of the current script
// SCRIPT_VERSION="0.0.1";
// // font for layout
// // FONT="Ubuntu Sans Mono:style=Regular";
// FONT="SquareFont:style=Regular";
// // the test number ref number for this set of IDTs
// test_number = 1;
// // this is needed due to the min size value
// // a pre scaler for the given values
// scale_unit = 1e3;
// // ================= meta =================
// // ================= IDT =================
// // the underlying substrate
// substrate = "SI";
// // linbo
// // the acoustic wave speed in the substrate
// c = 3992.0;
// // si
// // c = 3159.0;
// // the target frequency of the IDT
// freq = 10.0e6;
// // the distance between the input and output IDT
// // should be between 100-200
// distance = 50;
// // the number of fingers the IDT has
// n_fingers = 50;
// // the length of the figure or aperture should be 50-70
// finger_length = 50;
// // the gap between both sides of the IDT (should be used for tweaking)
// gap = 0;
// // the thickness of the wire the connects all the fingers
// thickness = 0;
// // adds an ID number to an IDT, useful if you have multiple on a wafer
// has_id_number = false;
// // ================= IDT =================
// // ================= bond pad =================
// // the length of the bond pad leg from the edge of the IDT to the center of the bond pad
// leg_length = 0.003;
// // the width of the leg
// leg_width = 0.00001875;
// // the angle the leg comes off from the IDT,
// // positive angle means the leg is angled away
// // negitive angle means the leg is angled inwards
// leg_angle = 10;
// // the size of the bond pad
// size = 0.002;
// // the shape of the bond pad (not implemented)
// bond_pad_shape = "square";
// // ================= bond pad =================
// // ================= text =================
// info_block_offset_x=25;
// info_block_offset_y=10;
// // total scale of infoblock
// info_block_scale=0.3;
// // the text size of the heading in the info block
// title_text_size = 4;
// // the size of all the sub items in the info block
// prop_text_size = 2.5;
// // the size of the ID numbers in on the IDTS
// id_text_size = 1;
// // ================= text =================
// // ================= wafers =================
// // the size of the wafer in inchs (why inch and not metric like everything else because its standard)
// wafer_size_inch = 4;
// // ================= wafers =================