Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenMesh
openmesh-python
Commits
177240cf
Commit
177240cf
authored
Feb 06, 2018
by
Alexander Dielen
Browse files
fixed potentially unsafe copy
parent
0ef632d1
Pipeline
#6166
passed with stage
in 1 minute and 9 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/MeshTypes.hh
View file @
177240cf
...
...
@@ -125,7 +125,7 @@ public:
const
Handle
hnd
(
i
);
const
py
::
object
obj
=
Mesh
::
property
(
prop
,
hnd
);
try
{
const
auto
arr
=
obj
.
cast
<
py
::
array_t
<
double
>
>
();
const
auto
arr
=
make_c_style
(
obj
.
cast
<
py
::
array_t
<
double
>
>
()
)
;
if
(
arr
.
size
()
!=
size
)
{
throw
py
::
error_already_set
();
}
...
...
src/Utilities.hh
View file @
177240cf
...
...
@@ -2,6 +2,8 @@
#define OPENMESH_PYTHON_UTILITIES_HH
#include <pybind11/pybind11.h>
#include <pybind11/numpy.h>
namespace
py
=
pybind11
;
...
...
@@ -13,4 +15,9 @@ py::capsule free_when_done(dtype *data) {
});
}
template
<
class
dtype
>
py
::
array_t
<
dtype
,
py
::
array
::
c_style
|
py
::
array
::
forcecast
>
make_c_style
(
py
::
array_t
<
dtype
>
_arr
)
{
return
_arr
;
}
#endif
Write
Preview
Supports
Markdown
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