Skip to content

Commit 0f250e5

Browse files
committed
Merge branch 'release/3.2.0'
2 parents fd1b497 + 2b6fcf2 commit 0f250e5

31 files changed

+1166
-900
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ jobs:
1111
timeout-minutes: 10
1212
strategy:
1313
matrix:
14-
python-version: ['3.8', '3.9', '3.10']
14+
python-version: ['3.9', '3.10', '3.11', '3.12']
15+
numpy-version: ['numpy1', 'numpy2']
1516

1617
steps:
1718
- uses: actions/checkout@v3
@@ -23,5 +24,14 @@ jobs:
2324
run: |
2425
python -m pip install --upgrade pip
2526
pip install tox tox-gh-actions
27+
- name: python version
28+
env:
29+
TOXENV: "py${{ matrix.python }}-${{ matrix.numpy-version }}"
30+
run: |
31+
TOXENV=${{ env.TOXENV }}
32+
TOXENV=${TOXENV//.} # replace all dots
33+
echo TOXENV=${TOXENV} >> $GITHUB_ENV # update GitHub ENV vars
34+
- name: print env
35+
run: echo ${{ env.TOXENV }}
2636
- name: Test with tox
2737
run: tox

README.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,39 @@ Extending Mesh objects
300300
# Show the plot to the screen
301301
pyplot.show()
302302
303+
Creating a single triangle
304+
----------------------------------
305+
306+
.. code-block:: python
307+
308+
import numpy
309+
from stl import mesh
310+
311+
# A unit triangle
312+
tri_vectors = [[0,0,0],[0,1,0],[0,0,1]]
313+
314+
# Create the vector data. It’s a numpy structured array with N entries, where N is the number of triangles (here N=1), and each entry is in the format ('normals','vectors','attr')
315+
data = numpy.array([(
316+
0, # Set 'normals' to zero, and the mesh class will automatically calculate them at initialization
317+
tri_vectors, # 'vectors'
318+
0 # 'attr'
319+
)], dtype = mesh.Mesh.dtype) # The structure defined by the mesh class (N x ('normals','vectors','attr'))
320+
321+
# Create the mesh object from the structured array
322+
tri_mesh = mesh.Mesh(data)
323+
324+
# Optionally make a plot for fun
325+
# Load the plot tools
326+
from matplotlib import pyplot
327+
from mpl_toolkits import mplot3d
328+
329+
# Create a new plot
330+
figure = pyplot.figure()
331+
axes = figure.add_subplot(projection='3d')
332+
333+
# Add mesh to plot
334+
axes.add_collection3d(mplot3d.art3d.Poly3DCollection(tri_mesh.vectors)) # Just need the 'vectors' attribute for display
335+
303336
Creating Mesh objects from a list of vertices and faces
304337
------------------------------------------------------------------------------
305338

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ install:
2828
build: false # Not a C# project, build stuff at the test step instead.
2929

3030
before_test:
31-
- py -m pip install tox numpy cython wheel
31+
- py -m pip install tox numpy cython wheel setuptools
3232

3333
test_script:
3434
- "py -m tox -e %TOXENV%"

docs/_theme/flask_theme_support.py

Lines changed: 76 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,89 @@
11
# flasky extensions. flasky pygments style based on tango style
22
from pygments.style import Style
3-
from pygments.token import Keyword, Name, Comment, String, Error, \
4-
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
3+
from pygments.token import (
4+
Comment,
5+
Error,
6+
Generic,
7+
Keyword,
8+
Literal,
9+
Name,
10+
Number,
11+
Operator,
12+
Other,
13+
Punctuation,
14+
String,
15+
Whitespace,
16+
)
517

618

719
class FlaskyStyle(Style):
8-
background_color = "#f8f8f8"
9-
default_style = ""
20+
background_color = '#f8f8f8'
21+
default_style = ''
1022

1123
styles = {
1224
# No corresponding class for the following:
1325
# Text: "", # class: ''
14-
Whitespace: "underline #f8f8f8", # class: 'w'
15-
Error: "#a40000 border:#ef2929", # class: 'err'
16-
Other: "#000000", # class 'x'
17-
18-
Comment: "italic #8f5902", # class: 'c'
19-
Comment.Preproc: "noitalic", # class: 'cp'
20-
21-
Keyword: "bold #004461", # class: 'k'
22-
Keyword.Constant: "bold #004461", # class: 'kc'
23-
Keyword.Declaration: "bold #004461", # class: 'kd'
24-
Keyword.Namespace: "bold #004461", # class: 'kn'
25-
Keyword.Pseudo: "bold #004461", # class: 'kp'
26-
Keyword.Reserved: "bold #004461", # class: 'kr'
27-
Keyword.Type: "bold #004461", # class: 'kt'
28-
29-
Operator: "#582800", # class: 'o'
30-
Operator.Word: "bold #004461", # class: 'ow' - like keywords
31-
32-
Punctuation: "bold #000000", # class: 'p'
33-
26+
Whitespace: 'underline #f8f8f8', # class: 'w'
27+
Error: '#a40000 border:#ef2929', # class: 'err'
28+
Other: '#000000', # class 'x'
29+
Comment: 'italic #8f5902', # class: 'c'
30+
Comment.Preproc: 'noitalic', # class: 'cp'
31+
Keyword: 'bold #004461', # class: 'k'
32+
Keyword.Constant: 'bold #004461', # class: 'kc'
33+
Keyword.Declaration: 'bold #004461', # class: 'kd'
34+
Keyword.Namespace: 'bold #004461', # class: 'kn'
35+
Keyword.Pseudo: 'bold #004461', # class: 'kp'
36+
Keyword.Reserved: 'bold #004461', # class: 'kr'
37+
Keyword.Type: 'bold #004461', # class: 'kt'
38+
Operator: '#582800', # class: 'o'
39+
Operator.Word: 'bold #004461', # class: 'ow' - like keywords
40+
Punctuation: 'bold #000000', # class: 'p'
3441
# because special names such as Name.Class, Name.Function, etc.
3542
# are not recognized as such later in the parsing, we choose them
3643
# to look the same as ordinary variables.
37-
Name: "#000000", # class: 'n'
38-
Name.Attribute: "#c4a000", # class: 'na' - to be revised
39-
Name.Builtin: "#004461", # class: 'nb'
40-
Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
41-
Name.Class: "#000000", # class: 'nc' - to be revised
42-
Name.Constant: "#000000", # class: 'no' - to be revised
43-
Name.Decorator: "#888", # class: 'nd' - to be revised
44-
Name.Entity: "#ce5c00", # class: 'ni'
45-
Name.Exception: "bold #cc0000", # class: 'ne'
46-
Name.Function: "#000000", # class: 'nf'
47-
Name.Property: "#000000", # class: 'py'
48-
Name.Label: "#f57900", # class: 'nl'
49-
Name.Namespace: "#000000", # class: 'nn' - to be revised
50-
Name.Other: "#000000", # class: 'nx'
51-
Name.Tag: "bold #004461", # class: 'nt' - like a keyword
52-
Name.Variable: "#000000", # class: 'nv' - to be revised
53-
Name.Variable.Class: "#000000", # class: 'vc' - to be revised
54-
Name.Variable.Global: "#000000", # class: 'vg' - to be revised
55-
Name.Variable.Instance: "#000000", # class: 'vi' - to be revised
56-
57-
Number: "#990000", # class: 'm'
58-
59-
Literal: "#000000", # class: 'l'
60-
Literal.Date: "#000000", # class: 'ld'
61-
62-
String: "#4e9a06", # class: 's'
63-
String.Backtick: "#4e9a06", # class: 'sb'
64-
String.Char: "#4e9a06", # class: 'sc'
65-
String.Doc: "italic #8f5902", # class: 'sd' - like a comment
66-
String.Double: "#4e9a06", # class: 's2'
67-
String.Escape: "#4e9a06", # class: 'se'
68-
String.Heredoc: "#4e9a06", # class: 'sh'
69-
String.Interpol: "#4e9a06", # class: 'si'
70-
String.Other: "#4e9a06", # class: 'sx'
71-
String.Regex: "#4e9a06", # class: 'sr'
72-
String.Single: "#4e9a06", # class: 's1'
73-
String.Symbol: "#4e9a06", # class: 'ss'
74-
75-
Generic: "#000000", # class: 'g'
76-
Generic.Deleted: "#a40000", # class: 'gd'
77-
Generic.Emph: "italic #000000", # class: 'ge'
78-
Generic.Error: "#ef2929", # class: 'gr'
79-
Generic.Heading: "bold #000080", # class: 'gh'
80-
Generic.Inserted: "#00A000", # class: 'gi'
81-
Generic.Output: "#888", # class: 'go'
82-
Generic.Prompt: "#745334", # class: 'gp'
83-
Generic.Strong: "bold #000000", # class: 'gs'
84-
Generic.Subheading: "bold #800080", # class: 'gu'
85-
Generic.Traceback: "bold #a40000", # class: 'gt'
44+
Name: '#000000', # class: 'n'
45+
Name.Attribute: '#c4a000', # class: 'na' - to be revised
46+
Name.Builtin: '#004461', # class: 'nb'
47+
Name.Builtin.Pseudo: '#3465a4', # class: 'bp'
48+
Name.Class: '#000000', # class: 'nc' - to be revised
49+
Name.Constant: '#000000', # class: 'no' - to be revised
50+
Name.Decorator: '#888', # class: 'nd' - to be revised
51+
Name.Entity: '#ce5c00', # class: 'ni'
52+
Name.Exception: 'bold #cc0000', # class: 'ne'
53+
Name.Function: '#000000', # class: 'nf'
54+
Name.Property: '#000000', # class: 'py'
55+
Name.Label: '#f57900', # class: 'nl'
56+
Name.Namespace: '#000000', # class: 'nn' - to be revised
57+
Name.Other: '#000000', # class: 'nx'
58+
Name.Tag: 'bold #004461', # class: 'nt' - like a keyword
59+
Name.Variable: '#000000', # class: 'nv' - to be revised
60+
Name.Variable.Class: '#000000', # class: 'vc' - to be revised
61+
Name.Variable.Global: '#000000', # class: 'vg' - to be revised
62+
Name.Variable.Instance: '#000000', # class: 'vi' - to be revised
63+
Number: '#990000', # class: 'm'
64+
Literal: '#000000', # class: 'l'
65+
Literal.Date: '#000000', # class: 'ld'
66+
String: '#4e9a06', # class: 's'
67+
String.Backtick: '#4e9a06', # class: 'sb'
68+
String.Char: '#4e9a06', # class: 'sc'
69+
String.Doc: 'italic #8f5902', # class: 'sd' - like a comment
70+
String.Double: '#4e9a06', # class: 's2'
71+
String.Escape: '#4e9a06', # class: 'se'
72+
String.Heredoc: '#4e9a06', # class: 'sh'
73+
String.Interpol: '#4e9a06', # class: 'si'
74+
String.Other: '#4e9a06', # class: 'sx'
75+
String.Regex: '#4e9a06', # class: 'sr'
76+
String.Single: '#4e9a06', # class: 's1'
77+
String.Symbol: '#4e9a06', # class: 'ss'
78+
Generic: '#000000', # class: 'g'
79+
Generic.Deleted: '#a40000', # class: 'gd'
80+
Generic.Emph: 'italic #000000', # class: 'ge'
81+
Generic.Error: '#ef2929', # class: 'gr'
82+
Generic.Heading: 'bold #000080', # class: 'gh'
83+
Generic.Inserted: '#00A000', # class: 'gi'
84+
Generic.Output: '#888', # class: 'go'
85+
Generic.Prompt: '#745334', # class: 'gp'
86+
Generic.Strong: 'bold #000000', # class: 'gs'
87+
Generic.Subheading: 'bold #800080', # class: 'gu'
88+
Generic.Traceback: 'bold #a40000', # class: 'gt'
8689
}

0 commit comments

Comments
 (0)