-
Notifications
You must be signed in to change notification settings - Fork 23
Home
Our goal in this quickstart guide is to create this simple example baseplate
The general format for a baseplate script is as follows:
from PyOptic import layout, optomech
# define baseplate constants, calculate parameters, etc.
# define the baseplate as a function so it can be imported into other files
def example_baseplate(x=0, y=0, angle=0):
# define baseplate and beam
# add components
# draw the baseplate if the file is run as a macro
if __name__ == "__main__":
example_baseplate()
layout.redraw()
The first thing to do is define our baseplate parameters and other constants
For most files, this will look something like this:
# baseplate sizing
base_dx = 4*layout.inch
base_dy = 4*layout.inch
base_dz = layout.inch
gap = layout.inch/8
# x-y coordinates of mount holes (in inches)
mount_holes = [(0, 0), (0, 3), (3, 0), (3, 3)]
# y coordinate of beam input
input_y = 1.5*layout.inch
The footprint of a given baseplate is defined by the dx and dy parameters with a gap distance removed from all sides. Because of this, the dx and dy parameters more so define the space allotted to the baseplate rather than its physical size. The gap defines the tolerance around the baseplate such that two can be mounted directly next to one another without issue.
Next we can start building our layout
Everything we add to our layout should be defined inside of a function it can be imported into other files.
def example_baseplate(x=0, y=0, angle=0):
# define and place baseplate object
baseplate = layout.baseplate(base_dx, base_dy, base_dz, x=x, y=y, angle=angle, gap=gap, mount_holes=mount_holes)
It's important to save the baseplate instance here as it will be used to place all the components.
... More to be added ...