Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
openmesh-python
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenMesh
openmesh-python
Commits
3d6daafc
Commit
3d6daafc
authored
May 15, 2018
by
Alexander Dielen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes
#15
parent
97f1a618
Pipeline
#6966
passed with stages
in 5 minutes and 42 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
src/MeshTypes.hh
src/MeshTypes.hh
+11
-4
No files found.
src/MeshTypes.hh
View file @
3d6daafc
...
...
@@ -88,7 +88,8 @@ public:
const
auto
prop
=
py_prop_on_demand
<
Handle
,
PropHandle
>
(
_name
);
if
(
_list
.
size
()
!=
n
)
{
return
;
PyErr_SetString
(
PyExc_RuntimeError
,
"List must have length n."
);
throw
py
::
error_already_set
();
}
for
(
size_t
i
=
0
;
i
<
n
;
++
i
)
{
Mesh
::
property
(
prop
,
Handle
(
i
))
=
py
::
object
(
_list
[
i
]);
...
...
@@ -150,9 +151,15 @@ public:
const
size_t
n
=
py_n_items
(
Handle
());
const
auto
prop
=
py_prop_on_demand
<
Handle
,
PropHandle
>
(
_name
);
// array cannot be empty and its shape has to be (_n, m,...)
if
(
_arr
.
size
()
==
0
||
_arr
.
ndim
()
<
2
||
_arr
.
shape
(
0
)
!=
n
)
{
return
;
// array cannot be empty and its shape has to be (n, ...)
if
(
_arr
.
size
()
==
0
||
_arr
.
ndim
()
<
1
||
_arr
.
shape
(
0
)
!=
n
)
{
PyErr_SetString
(
PyExc_RuntimeError
,
"Array must have shape (n, ...)."
);
throw
py
::
error_already_set
();
}
// reshape to (n, 1) if necessary
if
(
_arr
.
ndim
()
==
1
)
{
_arr
.
resize
({
n
,
size_t
(
1
)});
}
// copy one array at a time
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment