Adding line types to docs

This commit is contained in:
gumyr 2023-07-25 11:34:56 -04:00
parent 54aa6a4608
commit 50c7254c71
4 changed files with 1155 additions and 1 deletions

1071
docs/assets/line_types.svg Normal file

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 335 KiB

View file

@ -108,6 +108,38 @@ specific properties followed by the addition of layers and shapes to the documen
Once all of the layers and shapes have been added, the document can be written
to a file.
LineType
--------
ANSI (American National Standards Institute) and ISO (International Organization for
Standardization) standards both define line types in drawings used in DXF and SVG
exported drawings:
* ANSI Standards:
* ANSI/ASME Y14.2 - "Line Conventions and Lettering" is the standard that defines
line types, line weights, and line usage in engineering drawings in the United States.
* ISO Standards:
* ISO 128 - "Technical drawings -- General principles of presentation" is the ISO
standard that covers the general principles of technical drawing presentation,
including line types and line conventions.
* ISO 13567 - "Technical product documentation (TPD) -- Organization and naming of
layers for CAD" provides guidelines for the organization and naming of layers in
Computer-Aided Design (CAD) systems, which may include line type information.
These standards help ensure consistency and clarity in technical drawings, making it
easier for engineers, designers, and manufacturers to communicate and interpret the
information presented in the drawings.
The line types used by the 2D Exporters are defined by the :class:`~exporters.LineType`
Enum and are shown in the following diagram:
.. image:: assets/line_types.svg
:align: center
ExportDXF
---------
.. autoclass:: exporters.ExportDXF
:noindex:
@ -115,6 +147,9 @@ to a file.
.. automethod:: topology.Shape.export_dxf
:noindex:
ExportSVG
---------
.. autoclass:: exporters.ExportSVG
:noindex:

48
docs/line_types.py Normal file
View file

@ -0,0 +1,48 @@
"""
Create line type examples
name: line_types.py
by: Gumyr
date: July 25th 2023
desc:
This python module generates sample of all the available line types.
license:
Copyright 2023 Gumyr
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from build123d import *
exporter = ExportSVG(scale=1)
exporter.add_layer(name="Text", fill_color=(0, 0, 0))
line_types = [l for l in LineType.__members__]
text_locs = Pos((100, 0, 0)) * GridLocations(0, 6, 1, len(line_types)).locations
line_locs = Pos((105, 0, 0)) * GridLocations(0, 6, 1, len(line_types)).locations
for line_type, text_loc, line_loc in zip(line_types, text_locs, line_locs):
exporter.add_layer(name=line_type, line_type=getattr(LineType, line_type))
exporter.add_shape(
Compound.make_text(
"LineType." + line_type,
font_size=5,
align=(Align.MAX, Align.CENTER),
).locate(text_loc),
layer="Text",
)
exporter.add_shape(
Edge.make_line((0, 0), (100, 0)).locate(line_loc), layer=line_type
)
exporter.write("assets/line_types.svg")

View file

@ -10,7 +10,7 @@ desc:
license:
Copyright 2022 Gumyr
Copyright 2023 JRMobley
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.