math3d-py 1.0.15__cp313-cp313-macosx_26_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of math3d-py might be problematic. Click here for more details.

math3d/__init__.py ADDED
@@ -0,0 +1 @@
1
+ from .math3d import *
@@ -0,0 +1,15 @@
1
+ #pragma once
2
+ #include "pybind11/pybind11.h"
3
+ #include "LinearSystem.h"
4
+
5
+ namespace py = pybind11;
6
+
7
+ template<typename T, uint32_t Size>
8
+ void bind_linearSystem(py::module_ const& module, char const* className) {
9
+
10
+ using linear_system = math3d::LinearSystem<T, Size>;
11
+
12
+ py::class_<linear_system>(module, className)
13
+ .def_static("solve", &linear_system::solveLinearSystem);
14
+
15
+ }
math3d/math3d.cpp ADDED
@@ -0,0 +1,116 @@
1
+ #include "pybind11/pybind11.h"
2
+ #include "vector.hpp"
3
+ #include "matrix.hpp"
4
+ #include "linear_system.hpp"
5
+ #include "types.hpp"
6
+
7
+ #include <unordered_map>
8
+ #include <format>
9
+
10
+ namespace {
11
+
12
+ #ifdef MAX_DIMENSIONS
13
+ auto constexpr MaxDimension {MAX_DIMENSIONS};
14
+ #else
15
+ auto constexpr MaxDimension {4};
16
+ #endif
17
+
18
+ enum class Type : uint8_t {
19
+ Vector,
20
+ Matrix,
21
+ LinearSystem,
22
+ IdentityMatrix,
23
+ Extent,
24
+ Bounds
25
+ };
26
+ std::unordered_map<Type, char const*> TypePrefixMap {
27
+ {Type::Vector, "Vector"},
28
+ {Type::Matrix, "Matrix"},
29
+ {Type::LinearSystem, "LinearSystem"},
30
+ {Type::IdentityMatrix, "Identity"},
31
+ {Type::Bounds, "AABB"},
32
+ {Type::Extent, "Extent"}
33
+ };
34
+
35
+ template<typename Type, Type Start, Type End>
36
+ class TypeIterator {
37
+ public:
38
+ TypeIterator() = default;
39
+
40
+ TypeIterator begin() {
41
+ return *this;
42
+ }
43
+
44
+ TypeIterator end() {
45
+ return TypeIterator{End + 1};
46
+ }
47
+
48
+ bool operator==(TypeIterator const& another) {
49
+ return value == another.value;
50
+ }
51
+
52
+ private:
53
+ std::underlying_type_t<Type> value {Start};
54
+ };
55
+
56
+ auto pyCompositeTypeCreator = [](Type const type, pybind11::module_ const& pythonModule, auto const integerConstant) {
57
+ constexpr uint8_t dimension = integerConstant + 2;
58
+ auto const typeName = TypePrefixMap[type] + std::to_string(dimension);
59
+ if (typeName.empty()) {
60
+ throw std::runtime_error{std::format("Unknown type {}", std::to_underlying(type))};
61
+ }
62
+ switch (type) {
63
+ case Type::Vector:
64
+ bind_Vector<double, dimension>(pythonModule, typeName.c_str());
65
+ break;
66
+ case Type::Matrix:
67
+ bind_Matrix<double, dimension, dimension>(pythonModule, typeName.c_str());
68
+ break;
69
+ case Type::LinearSystem:
70
+ bind_linearSystem<double, dimension>(pythonModule, typeName.c_str());
71
+ break;
72
+ case Type::IdentityMatrix:
73
+ bind_identityMatrix<double, dimension, dimension>(pythonModule, typeName.c_str());
74
+ break;
75
+ default:
76
+ break;
77
+ }
78
+ };
79
+
80
+ void createSimpleType(Type const type, pybind11::module_ const& module) {
81
+ auto const typeName = TypePrefixMap.at(type);
82
+ switch (type) {
83
+ case Type::Extent:
84
+ bind_Extent<double>(module, typeName);
85
+ break;
86
+ case Type::Bounds:
87
+ bind_Bounds<double>(module, typeName);
88
+ break;
89
+ default:
90
+ throw std::runtime_error(std::format("Unknown simple type {}", std::to_underlying(type)));
91
+ }
92
+
93
+ }
94
+
95
+ template <uint8_t... integers>
96
+ void createCompositeType(Type const type, pybind11::module_& module, std::integer_sequence<uint8_t, integers...>) {
97
+ (pyCompositeTypeCreator(type, module, std::integral_constant<uint8_t, integers>{}), ...);
98
+ }
99
+ }
100
+
101
+ PYBIND11_MODULE(math3d, module) {
102
+ // NOTE: std::make_integer_sequence returns integer_sequence<unsigned, 0, 1, ... , N-1>
103
+ // Therefore, when MaxDimension is 4, the integer sequence is 0, 1, 2 (range [0, 3)), which gets is translated to
104
+ // types with suffix 2, 3, 4 e.g. vec2, vec3, and vec4
105
+ auto constexpr intSeq = std::make_integer_sequence<uint8_t, MaxDimension-1>{};
106
+ createCompositeType(Type::Vector, module, intSeq);
107
+ py::enum_<math3d::Order>(module, "order")
108
+ .value("row_major", math3d::Order::RowMajor)
109
+ .value("col_major", math3d::Order::ColumnMajor)
110
+ .export_values();
111
+ createCompositeType(Type::Matrix, module, intSeq);
112
+ createCompositeType(Type::LinearSystem, module, intSeq);
113
+ createCompositeType(Type::IdentityMatrix, module, intSeq);
114
+ createSimpleType(Type::Extent, module);
115
+ createSimpleType(Type::Bounds, module);
116
+ }
Binary file
math3d/matrix.hpp ADDED
@@ -0,0 +1,57 @@
1
+ #pragma once
2
+ #include "pybind11/pybind11.h"
3
+ #include "pybind11/operators.h"
4
+
5
+ #include "MatrixOperations.h"
6
+
7
+ namespace py = pybind11;
8
+
9
+ template<typename T, uint32_t Rows, uint32_t Cols>
10
+ void bind_Matrix(py::module_ const& module, char const* className) {
11
+
12
+ using matrix = math3d::Matrix<T, Rows, Cols>;
13
+ using vector = math3d::Vector<T, Cols>;
14
+
15
+ py::class_<matrix>(module, className)
16
+ .def(py::init())
17
+ .def(py::init([](py::iterable const& data, math3d::Order const order) {
18
+ std::vector<std::vector<T>> dataAsVec;
19
+ for (auto outer : data) {
20
+ std::vector<T> inner = outer.cast<std::vector<T>>();
21
+ dataAsVec.push_back(std::move(inner));
22
+ }
23
+ return matrix{dataAsVec, order};
24
+ }))
25
+ .def("__getitem__", [](matrix const& matrix, uint32_t const index) {
26
+ return matrix.operator[](index);
27
+ })
28
+ .def("__getitem__", [](matrix const& matrix, std::pair<uint32_t, uint32_t> const& index_pair) {
29
+ return matrix.operator()(index_pair.first, index_pair.second);
30
+ })
31
+ .def("row", [](matrix const& matrix, uint32_t row) {
32
+ return matrix.operator()(row);
33
+ })
34
+ .def(py::self * py::self)
35
+ .def(py::self * vector{})
36
+ .def("__str__", &matrix::asString)
37
+ .def("__repr__", &matrix::asString)
38
+
39
+ // Operations
40
+ .def("transpose", &matrix::transpose)
41
+ .def("upper_triangular", [](matrix const& input) {
42
+ matrix output;
43
+ input.convertToUpperTriangular(output);
44
+ return output;
45
+ })
46
+ .def("determinant", &matrix::determinant)
47
+ .def("inverse", &matrix::inverse)
48
+ ;
49
+ }
50
+
51
+ template<typename T, uint32_t Rows, uint32_t Cols>
52
+ void bind_identityMatrix(py::module_ const& module, char const* className) {
53
+ using identityMatrix = math3d::IdentityMatrix<T, Rows, Cols>;
54
+ using matrix = math3d::Matrix<T, Rows, Cols>;
55
+ py::class_<identityMatrix, matrix>(module, className)
56
+ .def(py::init());
57
+ }
math3d/types.hpp ADDED
@@ -0,0 +1,55 @@
1
+ #pragma once
2
+
3
+ #include "pybind11/pybind11.h"
4
+
5
+ #include "SupportingTypes.h"
6
+
7
+ namespace py = pybind11;
8
+ namespace m3d = math3d;
9
+
10
+ template<typename T>
11
+ void bind_Extent(py::module_ const& module, std::string_view className) {
12
+ using Extent = m3d::Extent<T>;
13
+ py::class_<Extent>(module, className.data())
14
+ .def(py::init([](T min, T max) {
15
+ Extent extent {};
16
+ extent.min = min;
17
+ extent.max = max;
18
+ return extent;
19
+ }))
20
+ .def("length", [](Extent const& extent) {
21
+ return extent.length();
22
+ })
23
+ .def("center", [](Extent const& extent) {
24
+ return extent.center();
25
+ })
26
+ .def("__str__", [](Extent const& extent) {
27
+ return extent.asString();
28
+ })
29
+ .def("__repr__", [](Extent const& extent) {
30
+ return std::format("Extent = {} Valid = {}", extent.asString(), extent.min < extent.max);
31
+ });
32
+ }
33
+
34
+ template<typename T>
35
+ void bind_Bounds(py::module_ const& module, std::string_view className) {
36
+ using Bounds = m3d::Bounds3D<T>;
37
+ py::class_<Bounds>(module, className.data())
38
+ .def(py::init())
39
+ .def(py::init([](m3d::Extent<T> const& x, m3d::Extent<T> const& y, m3d::Extent<T> const& z) {
40
+ return Bounds {x, y, z};
41
+ }))
42
+ .def("__str__", [](Bounds const& bounds) {
43
+ return bounds.asString();
44
+ })
45
+ .def("__repr__", [](Bounds const& bounds) {
46
+ return std::format(
47
+ "{} Valid = {}\n"
48
+ "Center = {}\n"
49
+ "X Length = {}\n"
50
+ "Y Length = {}\n"
51
+ "Z Length = {}\n"
52
+ "Diagonal Length {}", bounds.asString(), bounds.isValid(), bounds.center().asString(),
53
+ bounds.x.length(), bounds.y.length(), bounds.z.length(), bounds.length());
54
+ });
55
+ }
math3d/util.h ADDED
@@ -0,0 +1,13 @@
1
+ #pragma once
2
+ #include <ranges>
3
+ #include <string>
4
+ #include <algorithm>
5
+
6
+ namespace util {
7
+ inline auto convertSpaceToNewLine = [](std::string&& str) {
8
+ std::string result{std::move(str)};
9
+ std::ranges::replace(result.begin(), result.end(), ' ', '\n');
10
+ result = result.substr(1, result.size()-2);
11
+ return result;
12
+ };
13
+ }
math3d/vector.hpp ADDED
@@ -0,0 +1,83 @@
1
+ #pragma once
2
+ #include "pybind11/pybind11.h"
3
+ #include "pybind11/operators.h"
4
+ #include "pybind11/stl.h"
5
+ #include "util.h"
6
+ #include "Vector.h"
7
+
8
+ namespace py = pybind11;
9
+
10
+ template<typename T, uint32_t Size>
11
+ void bind_Vector(py::module_ const& module, char const* className) {
12
+ using vector = math3d::Vector<T, Size>;
13
+ auto vec_class =
14
+ py::class_<vector>(module, className)
15
+ // Construction
16
+ .def(py::init())
17
+ .def(py::init([](py::iterable const& list) {
18
+ auto const input = list.cast<std::vector<T>>();
19
+ return vector{input};
20
+ }))
21
+ .def(py::init([](math3d::Vector3<T> const& vec3) {
22
+ std::vector<T> input {vec3.x, vec3.y, vec3.z, 1.F};
23
+ return vector{input};
24
+ }))
25
+ // Member access
26
+ .def_property("x",
27
+ [](vector const& self) {
28
+ double const value = self.x;
29
+ return value;
30
+ },
31
+ [](vector& self, double const value) {
32
+ self.x = value;
33
+ }
34
+ )
35
+ .def_property("y",
36
+ [](vector const& self) {
37
+ T const value = self.y;
38
+ return value;
39
+ },
40
+ [](vector& self, double const value) {
41
+ self.y = value;
42
+ }
43
+ )
44
+ .def_property("z",
45
+ [](vector const& self) {
46
+ T const value = self.z;
47
+ return value;
48
+ },
49
+ [](vector& self, double const value) {
50
+ self.z = value;
51
+ }
52
+ )
53
+ // Formatted output
54
+ .def("__str__", [](vector const& v) {
55
+ return util::convertSpaceToNewLine(v.asString());
56
+ })
57
+ .def("__repr__", [](vector const& v) {
58
+ return util::convertSpaceToNewLine(v.asString());
59
+ })
60
+ // Operations
61
+ .def(py::self + py::self)
62
+ .def(py::self - py::self)
63
+ .def(py::self * T{})
64
+ .def(py::self / T{})
65
+ .def("dot", &vector::dot)
66
+ .def("normalize", [](vector& v) { v.normalize(); return v; })
67
+ .def("length", [](vector const& v) { return v.length(); })
68
+ .def("length_sqr", [](vector const& v) { return v.lengthSquared(); })
69
+ .def("projection", &vector::getVectorProjection);
70
+ if constexpr (Size == 3) {
71
+ vec_class
72
+ .def(py::init([](T x, T y, T z) {
73
+ return vector({x, y, z});
74
+ }))
75
+ .def(py::self * py::self);
76
+ }
77
+ if constexpr (Size == 4) {
78
+ vec_class
79
+ .def(py::init([](T x, T y, T z, T w) {
80
+ return vector({x, y, z, w});
81
+ }));
82
+ }
83
+ }
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.2
2
+ Name: math3d_py
3
+ Version: 1.0.15
4
+ Summary: Python bindings for 3dmath
5
+ Author-Email: Murali Dhanakoti <dhanakoti.murali@gmail.com>
6
+ Requires-Python: >=3.12
7
+
@@ -0,0 +1,12 @@
1
+ math3d/__init__.py,sha256=U3FgsmZvyl9BitOWo7kiMfFemdDIT0nZTtZAel8GCXs,21
2
+ math3d/linear_system.hpp,sha256=N0DaHua78qMjxq1hRrB_RFeG4-t6TO4MstGoNwLVCFs,379
3
+ math3d/math3d.cpp,sha256=RsEDIrIjGn06EucUdMHZZcNUru-UOc28Ufz9HobWu18,3942
4
+ math3d/math3d.cpython-313-darwin.so,sha256=8T3JJuvaUE5LT2kKtmjJLzH-8VRjklv6Na_5dBfhkWA,435936
5
+ math3d/matrix.hpp,sha256=eSaPQgQQuxGhtrtTVGn9UeI9EwquaF115qAUOaLcRG0,1921
6
+ math3d/types.hpp,sha256=cHG9oyXP2RhiNcYoDjm0rZWsVLYPMULMPGgvzTlMvcw,1714
7
+ math3d/util.h,sha256=toCfaPyeqdMrVyiic9_mSOaSjIj6WaBeXla0_7jOFFE,351
8
+ math3d/vector.hpp,sha256=LmuAudIoZpX6lGBN-PqIi50Z1o9Dca3UUxlZjLwYbIg,2611
9
+ math3d_py-1.0.15.dist-info/METADATA,sha256=O1_5tkPXm6tSs0dInddYKDQXirVt8yYCagw5q8fbY3g,175
10
+ math3d_py-1.0.15.dist-info/WHEEL,sha256=JBPQcDhGdVJVVdP1iHcQD7YbZNLPHXKI0EmTIQUqW5M,114
11
+ math3d_py-1.0.15.dist-info/licenses/LICENSE.txt,sha256=2AI_7H-vwBwrcWaaH8JmWMvJsT0rKRrENEAxZaxO1vc,18279
12
+ math3d_py-1.0.15.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: scikit-build-core 0.11.6
3
+ Root-Is-Purelib: false
4
+ Tag: cp313-cp313-macosx_26_0_arm64
5
+
@@ -0,0 +1,256 @@
1
+ Attribution-NonCommercial 4.0 International
2
+
3
+ =======================================================================
4
+
5
+ Creative Commons Corporation ("Creative Commons") is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an "as-is" basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
6
+
7
+ Using Creative Commons Public Licenses
8
+
9
+ Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
10
+
11
+ Considerations for licensors: Our public licenses are
12
+ intended for use by those authorized to give the public
13
+ permission to use material in ways otherwise restricted by
14
+ copyright and certain other rights. Our licenses are
15
+ irrevocable. Licensors should read and understand the terms
16
+ and conditions of the license they choose before applying it.
17
+ Licensors should also secure all rights necessary before
18
+ applying our licenses so that the public can reuse the
19
+ material as expected. Licensors should clearly mark any
20
+ material not subject to the license. This includes other CC-
21
+ licensed material, or material used under an exception or
22
+ limitation to copyright. More considerations for licensors:
23
+ wiki.creativecommons.org/Considerations_for_licensors
24
+
25
+ Considerations for the public: By using one of our public
26
+ licenses, a licensor grants the public permission to use the
27
+ licensed material under specified terms and conditions. If
28
+ the licensor's permission is not necessary for any reason--for
29
+ example, because of any applicable exception or limitation to
30
+ copyright--then that use is not regulated by the license. Our
31
+ licenses grant only permissions under copyright and certain
32
+ other rights that a licensor has authority to grant. Use of
33
+ the licensed material may still be restricted for other
34
+ reasons, including because others have copyright or other
35
+ rights in the material. A licensor may make special requests,
36
+ such as asking that all changes be marked or described.
37
+ Although not required by our licenses, you are encouraged to
38
+ respect those requests where reasonable. More considerations
39
+ for the public:
40
+ wiki.creativecommons.org/Considerations_for_licensees
41
+ =======================================================================
42
+
43
+ Creative Commons Attribution-NonCommercial 4.0 International Public License
44
+
45
+ By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
46
+
47
+ Section 1 -- Definitions.
48
+
49
+ a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
50
+
51
+ b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
52
+
53
+ c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
54
+
55
+ e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
56
+
57
+ f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
58
+
59
+ g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
60
+
61
+ h. Licensor means the individual(s) or entity(ies) granting rights under this Public License.
62
+
63
+ i. NonCommercial means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.
64
+
65
+ j. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
66
+
67
+ k. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
68
+
69
+ l. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
70
+
71
+ Section 2 -- Scope.
72
+
73
+ a. License grant.
74
+
75
+ 1. Subject to the terms and conditions of this Public License,
76
+ the Licensor hereby grants You a worldwide, royalty-free,
77
+ non-sublicensable, non-exclusive, irrevocable license to
78
+ exercise the Licensed Rights in the Licensed Material to:
79
+
80
+ a. reproduce and Share the Licensed Material, in whole or
81
+ in part, for NonCommercial purposes only; and
82
+
83
+ b. produce, reproduce, and Share Adapted Material for
84
+ NonCommercial purposes only.
85
+
86
+ 2. Exceptions and Limitations. For the avoidance of doubt, where
87
+ Exceptions and Limitations apply to Your use, this Public
88
+ License does not apply, and You do not need to comply with
89
+ its terms and conditions.
90
+
91
+ 3. Term. The term of this Public License is specified in Section
92
+ 6(a).
93
+
94
+ 4. Media and formats; technical modifications allowed. The
95
+ Licensor authorizes You to exercise the Licensed Rights in
96
+ all media and formats whether now known or hereafter created,
97
+ and to make technical modifications necessary to do so. The
98
+ Licensor waives and/or agrees not to assert any right or
99
+ authority to forbid You from making technical modifications
100
+ necessary to exercise the Licensed Rights, including
101
+ technical modifications necessary to circumvent Effective
102
+ Technological Measures. For purposes of this Public License,
103
+ simply making modifications authorized by this Section 2(a)
104
+ (4) never produces Adapted Material.
105
+
106
+ 5. Downstream recipients.
107
+
108
+ a. Offer from the Licensor -- Licensed Material. Every
109
+ recipient of the Licensed Material automatically
110
+ receives an offer from the Licensor to exercise the
111
+ Licensed Rights under the terms and conditions of this
112
+ Public License.
113
+
114
+ b. No downstream restrictions. You may not offer or impose
115
+ any additional or different terms or conditions on, or
116
+ apply any Effective Technological Measures to, the
117
+ Licensed Material if doing so restricts exercise of the
118
+ Licensed Rights by any recipient of the Licensed
119
+ Material.
120
+
121
+ 6. No endorsement. Nothing in this Public License constitutes or
122
+ may be construed as permission to assert or imply that You
123
+ are, or that Your use of the Licensed Material is, connected
124
+ with, or sponsored, endorsed, or granted official status by,
125
+ the Licensor or others designated to receive attribution as
126
+ provided in Section 3(a)(1)(A)(i).
127
+ b. Other rights.
128
+
129
+ 1. Moral rights, such as the right of integrity, are not
130
+ licensed under this Public License, nor are publicity,
131
+ privacy, and/or other similar personality rights; however, to
132
+ the extent possible, the Licensor waives and/or agrees not to
133
+ assert any such rights held by the Licensor to the limited
134
+ extent necessary to allow You to exercise the Licensed
135
+ Rights, but not otherwise.
136
+
137
+ 2. Patent and trademark rights are not licensed under this
138
+ Public License.
139
+
140
+ 3. To the extent possible, the Licensor waives any right to
141
+ collect royalties from You for the exercise of the Licensed
142
+ Rights, whether directly or through a collecting society
143
+ under any voluntary or waivable statutory or compulsory
144
+ licensing scheme. In all other cases the Licensor expressly
145
+ reserves any right to collect such royalties, including when
146
+ the Licensed Material is used other than for NonCommercial
147
+ purposes.
148
+ Section 3 -- License Conditions.
149
+
150
+ Your exercise of the Licensed Rights is expressly made subject to the following conditions.
151
+
152
+ a. Attribution.
153
+
154
+ 1. If You Share the Licensed Material (including in modified
155
+ form), You must:
156
+
157
+ a. retain the following if it is supplied by the Licensor
158
+ with the Licensed Material:
159
+
160
+ i. identification of the creator(s) of the Licensed
161
+ Material and any others designated to receive
162
+ attribution, in any reasonable manner requested by
163
+ the Licensor (including by pseudonym if
164
+ designated);
165
+
166
+ ii. a copyright notice;
167
+
168
+ iii. a notice that refers to this Public License;
169
+
170
+ iv. a notice that refers to the disclaimer of
171
+ warranties;
172
+
173
+ v. a URI or hyperlink to the Licensed Material to the
174
+ extent reasonably practicable;
175
+
176
+ b. indicate if You modified the Licensed Material and
177
+ retain an indication of any previous modifications; and
178
+
179
+ c. indicate the Licensed Material is licensed under this
180
+ Public License, and include the text of, or the URI or
181
+ hyperlink to, this Public License.
182
+
183
+ 2. You may satisfy the conditions in Section 3(a)(1) in any
184
+ reasonable manner based on the medium, means, and context in
185
+ which You Share the Licensed Material. For example, it may be
186
+ reasonable to satisfy the conditions by providing a URI or
187
+ hyperlink to a resource that includes the required
188
+ information.
189
+
190
+ 3. If requested by the Licensor, You must remove any of the
191
+ information required by Section 3(a)(1)(A) to the extent
192
+ reasonably practicable.
193
+
194
+ 4. If You Share Adapted Material You produce, the Adapter's
195
+ License You apply must not prevent recipients of the Adapted
196
+ Material from complying with this Public License.
197
+ Section 4 -- Sui Generis Database Rights.
198
+
199
+ Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
200
+
201
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only;
202
+
203
+ b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and
204
+
205
+ c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
206
+
207
+ For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
208
+
209
+ Section 5 -- Disclaimer of Warranties and Limitation of Liability.
210
+
211
+ a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
212
+
213
+ b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
214
+
215
+ c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
216
+
217
+ Section 6 -- Term and Termination.
218
+
219
+ a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
220
+
221
+ b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
222
+
223
+ 1. automatically as of the date the violation is cured, provided
224
+ it is cured within 30 days of Your discovery of the
225
+ violation; or
226
+
227
+ 2. upon express reinstatement by the Licensor.
228
+
229
+ For the avoidance of doubt, this Section 6(b) does not affect any
230
+ right the Licensor may have to seek remedies for Your violations
231
+ of this Public License.
232
+ c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
233
+
234
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
235
+
236
+ Section 7 -- Other Terms and Conditions.
237
+
238
+ a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
239
+
240
+ b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
241
+
242
+ Section 8 -- Interpretation.
243
+
244
+ a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
245
+
246
+ b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
247
+
248
+ c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
249
+
250
+ d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
251
+
252
+ =======================================================================
253
+
254
+ Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” The text of the Creative Commons public licenses is dedicated to the public domain under the CC0 Public Domain Dedication. Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark "Creative Commons" or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
255
+
256
+ Creative Commons may be contacted at creativecommons.org.