Draft: Update Draft example file (#23284)
* Draft: Update Draft example file Fixes #23198 I have added osifont-lgpl3fe.ttf to the example folder. The ShapeString in draft_test_objects.FCStd references it using a relative path. I am not sure if including the font here is allowed though. Additionally: The example file showed up an error in view_wire.py. It is also used for fillets (which do not have a Points property). * Updated * Also use a relative path for the PAT file. * Subfolder for the PAT and TTF files. * Update CMakeLists.txt * Update CMakeLists.txt * Update CMakeLists.txt * Update CMakeLists.txt * Update CMakeLists.txt * Update CMakeLists.txt
This commit is contained in:
@@ -8,6 +8,9 @@ SET(Examples_Files
|
||||
FEMExample.FCStd
|
||||
AssemblyExample.FCStd
|
||||
ArchDetail.FCStd
|
||||
draft_test_objects_files/FCPAT.pat
|
||||
draft_test_objects_files/osifont.license
|
||||
draft_test_objects_files/osifont-lgpl3fe.ttf
|
||||
)
|
||||
|
||||
ADD_CUSTOM_TARGET(Example_data ALL
|
||||
@@ -132,4 +135,3 @@ INSTALL(
|
||||
DESTINATION
|
||||
${CMAKE_INSTALL_DATADIR}/examples
|
||||
)
|
||||
|
||||
|
||||
Binary file not shown.
23
data/examples/draft_test_objects_files/FCPAT.pat
Normal file
23
data/examples/draft_test_objects_files/FCPAT.pat
Normal file
@@ -0,0 +1,23 @@
|
||||
; standard PAT patterns
|
||||
|
||||
*Diamond, 45 diagonals L & R, Solid, 1.0 mm separation
|
||||
45,0,0,0,1.0
|
||||
-45,0,0,0,1.0
|
||||
*Diamond2, 45 diagonals L & R, Solid, 2.0 mm separation
|
||||
45,0,0,0,2.0
|
||||
-45,0,0,0,2.0
|
||||
*Diamond4, 45 diagonals L & R, Solid, 4.0 mm separation
|
||||
45,0,0,0,4.0
|
||||
-45,0,0,0,4.0
|
||||
*Diagonal4, 45 diagonal R, Solid, 4.0 mm separation
|
||||
45,0,0,0,4.0
|
||||
*Diagonal5, 45 diagonal L, Solid, 4.0 mm separation
|
||||
-45,0,0,0,4.0
|
||||
*Square, square grid, Solid, 5.0 mm separation
|
||||
90,1,1,0,5.0
|
||||
0,0,0,1,5.0
|
||||
*Horizontal5, horizontal lines, Solid 5.0 separation
|
||||
0,0,0,0,5.0
|
||||
*Vertical5, vertical lines, Solid, 5.0 separation
|
||||
90,0,0,0,5.0
|
||||
|
||||
BIN
data/examples/draft_test_objects_files/osifont-lgpl3fe.ttf
Normal file
BIN
data/examples/draft_test_objects_files/osifont-lgpl3fe.ttf
Normal file
Binary file not shown.
9
data/examples/draft_test_objects_files/osifont.license
Normal file
9
data/examples/draft_test_objects_files/osifont.license
Normal file
@@ -0,0 +1,9 @@
|
||||
osifont license:
|
||||
|
||||
osifont-lgpl3fe.ttf is used under one or more of the following licenses:
|
||||
- GNU GPL licence version 3 with GPL font exception,
|
||||
- GNU GPL licence version 2 with GPL font exception,
|
||||
- GNU LGPL licence version 3 with GPL font exception.
|
||||
|
||||
|
||||
https://github.com/hikikomori82/osifont/
|
||||
@@ -452,7 +452,7 @@ def _create_objects(doc=None,
|
||||
# Circular array
|
||||
_msg(16 * "-")
|
||||
_msg("Circular array")
|
||||
polygon = Draft.make_polygon(5, 30)
|
||||
polygon = Draft.make_polygon(3, 30)
|
||||
polygon.Placement.Base = Vector(4250, 4250, 0)
|
||||
if App.GuiUp:
|
||||
polygon.ViewObject.Visibility = False
|
||||
@@ -463,14 +463,14 @@ def _create_objects(doc=None,
|
||||
3,
|
||||
1,
|
||||
Vector(0, 0, 1),
|
||||
Vector(0, 0, 0),
|
||||
Vector(4250, 4250, 0),
|
||||
use_link=False)
|
||||
_set_text(["Circular array"], Vector(4000, 3800, 0))
|
||||
|
||||
# Circular link array
|
||||
_msg(16 * "-")
|
||||
_msg("Circular link array")
|
||||
polygon = Draft.make_polygon(6, 30)
|
||||
polygon = Draft.make_polygon(4, 30)
|
||||
polygon.Placement.Base = Vector(5250, 4250, 0)
|
||||
if App.GuiUp:
|
||||
polygon.ViewObject.Visibility = False
|
||||
@@ -481,7 +481,7 @@ def _create_objects(doc=None,
|
||||
3,
|
||||
1,
|
||||
Vector(0, 0, 1),
|
||||
Vector(0, 0, 0),
|
||||
Vector(5250, 4250, 0),
|
||||
use_link=True)
|
||||
_set_text(["Circular link array"], Vector(5000, 3800, 0))
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@ class ViewProviderWire(ViewProviderDraft):
|
||||
|
||||
def updateData(self, obj, prop):
|
||||
if prop == "Points" \
|
||||
and hasattr(obj, "Points") \
|
||||
and len(obj.Points) >= 2 \
|
||||
and hasattr(self, "coords1") \
|
||||
and hasattr(self, "coords2"):
|
||||
|
||||
Reference in New Issue
Block a user