otmeshing 0.2.dev0__p39-abi3-win_amd64.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.
otmeshing/__init__.py ADDED
@@ -0,0 +1,19 @@
1
+ """
2
+ otmeshing --- An OpenTURNS module
3
+ ==================================
4
+
5
+ Contents
6
+ --------
7
+ 'otmeshing' is a module for OpenTURNS
8
+
9
+ """
10
+
11
+ # flake8: noqa
12
+
13
+ # ensures swig type tables order & dll load
14
+ import openturns as _ot
15
+
16
+ from .otmeshing import *
17
+
18
+ __version__ = '0.2dev0'
19
+
Binary file
Binary file
otmeshing/libcdd-0.dll ADDED
Binary file
Binary file
Binary file
Binary file
otmeshing/otmeshing.py ADDED
@@ -0,0 +1,1270 @@
1
+ # This file was automatically generated by SWIG (https://www.swig.org).
2
+ # Version 4.4.1
3
+ #
4
+ # Do not make changes to this file unless you know what you are doing - modify
5
+ # the SWIG interface file instead.
6
+
7
+ """otmeshing module"""
8
+
9
+ from sys import version_info as _swig_python_version_info
10
+ # Import the low-level C/C++ module
11
+ if getattr(globals().get("__spec__"), "parent", None) or __package__ or "." in __name__:
12
+ from . import _otmeshing
13
+ else:
14
+ import _otmeshing
15
+
16
+ try:
17
+ import builtins as __builtin__
18
+ except ImportError:
19
+ import __builtin__
20
+
21
+ def _swig_repr(self):
22
+ try:
23
+ strthis = "proxy of " + self.this.__repr__()
24
+ except __builtin__.Exception:
25
+ strthis = ""
26
+ return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
27
+
28
+
29
+ def _swig_setattr_nondynamic_instance_variable(set):
30
+ def set_instance_attr(self, name, value):
31
+ if name == "this":
32
+ set(self, name, value)
33
+ elif name == "thisown":
34
+ self.this.own(value)
35
+ elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
36
+ set(self, name, value)
37
+ else:
38
+ raise AttributeError("You cannot add instance attributes to %s" % self)
39
+ return set_instance_attr
40
+
41
+
42
+ def _swig_setattr_nondynamic_class_variable(set):
43
+ def set_class_attr(cls, name, value):
44
+ if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
45
+ set(cls, name, value)
46
+ else:
47
+ raise AttributeError("You cannot add class attributes to %s" % cls)
48
+ return set_class_attr
49
+
50
+
51
+ def _swig_add_metaclass(metaclass):
52
+ """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
53
+ def wrapper(cls):
54
+ return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
55
+ return wrapper
56
+
57
+
58
+ class _SwigNonDynamicMeta(type):
59
+ """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
60
+ __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
61
+
62
+
63
+ import openturns.base
64
+ import openturns.common
65
+ import openturns.typ
66
+ import openturns.statistics
67
+ import openturns.graph
68
+ import openturns.func
69
+ import openturns.geom
70
+ import openturns.iterative_statistics
71
+ import openturns.func2
72
+ import openturns.diff
73
+ import openturns.optim
74
+ import openturns.experiment
75
+ import openturns.solver
76
+ import openturns.algo
77
+ import openturns.uncertainty
78
+ import openturns.model_copula
79
+ import openturns.randomvector
80
+ import openturns.dist_bundle1
81
+ import openturns.dist_bundle2
82
+ import openturns.weightedexperiment
83
+ import openturns.classification
84
+ import openturns.orthogonalbasis
85
+ import openturns.metamodel
86
+ import openturns.model_process
87
+ import openturns.dist_bundle3
88
+ import openturns.transformation
89
+ import openturns.analytical
90
+ import openturns.simulation
91
+ import openturns.stattests
92
+ class CloudMesher(openturns.common.PersistentObject):
93
+ r"""
94
+ Mesher from a set of points.
95
+
96
+ Triangulates a set of points.
97
+
98
+ This can also be seen as the volumetric mesh (full cells) of the convex hull.
99
+
100
+ Parameters
101
+ ----------
102
+ triangulationMethod : int
103
+ Triangulation method to use, either:
104
+
105
+ - CloudMesher.BASIC (default)
106
+ - CloudMesher.DELAUNAY triangulation with the empty ball property (slower)
107
+
108
+ Examples
109
+ --------
110
+ Triangulate a set of points:
111
+
112
+ >>> import openturns as ot
113
+ >>> import otmeshing
114
+ >>> points = ot.JointDistribution([ot.Uniform()] * 2).getSample(15)
115
+ >>> mesher = otmeshing.CloudMesher(otmeshing.CloudMesher.DELAUNAY)
116
+ >>> triangulation = mesher.build(points)
117
+ """
118
+
119
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
120
+
121
+ def getClassName(self):
122
+ r"""
123
+ Accessor to the object's name.
124
+
125
+ Returns
126
+ -------
127
+ class_name : str
128
+ The object class name (`object.__class__.__name__`).
129
+ """
130
+ return _otmeshing.CloudMesher_getClassName(self)
131
+ BASIC = _otmeshing.CloudMesher_BASIC
132
+ DELAUNAY = _otmeshing.CloudMesher_DELAUNAY
133
+
134
+ def build(self, points):
135
+ r"""
136
+ Triangulate a set of points.
137
+
138
+ Parameters
139
+ ----------
140
+ points : :class:`~openturns.Sample`
141
+ A set of points.
142
+
143
+ Returns
144
+ -------
145
+ mesh : :class:`~openturns.Mesh`
146
+ The mesh built.
147
+ """
148
+ return _otmeshing.CloudMesher_build(self, points)
149
+
150
+ def __repr__(self):
151
+ return _otmeshing.CloudMesher___repr__(self)
152
+
153
+ def __init__(self, *args):
154
+ _otmeshing.CloudMesher_swiginit(self, _otmeshing.new_CloudMesher(*args))
155
+ __swig_destroy__ = _otmeshing.delete_CloudMesher
156
+
157
+ # Register CloudMesher in _otmeshing:
158
+ _otmeshing.CloudMesher_swigregister(CloudMesher)
159
+ class ConvexHullMesher(openturns.common.PersistentObject):
160
+ r"""
161
+ Meshing of the convex hull of a set of points.
162
+
163
+ Yields a surface mesh of the convex hull (of intrinsic dimension d-1).
164
+
165
+ Examples
166
+ --------
167
+ >>> import openturns as ot
168
+ >>> import otmeshing
169
+ >>> points = ot.Normal(2).getSample(100)
170
+ >>> mesher = otmeshing.ConvexHullMesher()
171
+ >>> hull = mesher.build(points)
172
+ """
173
+
174
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
175
+
176
+ def getClassName(self):
177
+ r"""
178
+ Accessor to the object's name.
179
+
180
+ Returns
181
+ -------
182
+ class_name : str
183
+ The object class name (`object.__class__.__name__`).
184
+ """
185
+ return _otmeshing.ConvexHullMesher_getClassName(self)
186
+
187
+ def build(self, points):
188
+ r"""
189
+ Buld the convex hull a set of points.
190
+
191
+ Parameters
192
+ ----------
193
+ points : :class:`~openturns.Sample`
194
+ A set of points.
195
+
196
+ Returns
197
+ -------
198
+ mesh : :class:`~openturns.Mesh`
199
+ The convex hull.
200
+ """
201
+ return _otmeshing.ConvexHullMesher_build(self, points)
202
+
203
+ def __repr__(self):
204
+ return _otmeshing.ConvexHullMesher___repr__(self)
205
+
206
+ def __init__(self, *args):
207
+ _otmeshing.ConvexHullMesher_swiginit(self, _otmeshing.new_ConvexHullMesher(*args))
208
+ __swig_destroy__ = _otmeshing.delete_ConvexHullMesher
209
+
210
+ # Register ConvexHullMesher in _otmeshing:
211
+ _otmeshing.ConvexHullMesher_swigregister(ConvexHullMesher)
212
+ class ConvexDecompositionMesher(openturns.common.PersistentObject):
213
+ r"""
214
+ Build a convex decomposition.
215
+
216
+ Notes
217
+ -----
218
+ The following keys in :class:`openturns.ResourceMap` can be configured:
219
+
220
+ - *ConvexDecompositionMesher-Threshold*: concavity threshold for CoACD
221
+ decomposition (default=0.05).
222
+
223
+ """
224
+
225
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
226
+
227
+ def getClassName(self):
228
+ r"""
229
+ Accessor to the object's name.
230
+
231
+ Returns
232
+ -------
233
+ class_name : str
234
+ The object class name (`object.__class__.__name__`).
235
+ """
236
+ return _otmeshing.ConvexDecompositionMesher_getClassName(self)
237
+
238
+ def build(self, mesh):
239
+ r"""
240
+ Build a convex decomposition.
241
+
242
+ Parameters
243
+ ----------
244
+ mesh : :class:`~openturns.Mesh`
245
+ A mesh.
246
+
247
+ Returns
248
+ -------
249
+ decomposition : sequence of :class:`~openturns.Mesh`
250
+ A sequence of non-convex polyhedra.
251
+ """
252
+ return _otmeshing.ConvexDecompositionMesher_build(self, mesh)
253
+
254
+ def __repr__(self):
255
+ return _otmeshing.ConvexDecompositionMesher___repr__(self)
256
+
257
+ @staticmethod
258
+ def IsConvex(mesh):
259
+ r"""
260
+ Test whether a mesh is convex.
261
+
262
+ We test the volume of the mesh versus the volume of its convex hull.
263
+
264
+ Parameters
265
+ ----------
266
+ mesh : :py:class:`openturns.Mesh`
267
+ A mesh.
268
+
269
+ Returns
270
+ -------
271
+ isConvex : bool
272
+ Whether the mesh is convex.
273
+
274
+ """
275
+ return _otmeshing.ConvexDecompositionMesher_IsConvex(mesh)
276
+
277
+ def setUseSimplicesDecomposition(self, useSimplicesDecomposition):
278
+ r"""
279
+ Simplicial decomposition flag accessor.
280
+
281
+ Parameters
282
+ ----------
283
+ useSimplicesDecomposition : bool
284
+ Whether to decompose the mesh by its simplices.
285
+
286
+ """
287
+ return _otmeshing.ConvexDecompositionMesher_setUseSimplicesDecomposition(self, useSimplicesDecomposition)
288
+
289
+ def getUseSimplicesDecomposition(self):
290
+ r"""
291
+ Simplicial decomposition flag accessor.
292
+
293
+ Returns
294
+ -------
295
+ useSimplicesDecomposition : bool
296
+ Whether to decompose the mesh by its simplices.
297
+
298
+ """
299
+ return _otmeshing.ConvexDecompositionMesher_getUseSimplicesDecomposition(self)
300
+
301
+ @staticmethod
302
+ def HasFeature(feature):
303
+ r"""
304
+ Test available features.
305
+
306
+ Parameters
307
+ ----------
308
+ feature : str
309
+ A feature (for example coacd).
310
+
311
+ Returns
312
+ -------
313
+ hasFeature : bool
314
+ Whether the feature is enabled.
315
+
316
+ """
317
+ return _otmeshing.ConvexDecompositionMesher_HasFeature(feature)
318
+
319
+ def __init__(self, *args):
320
+ _otmeshing.ConvexDecompositionMesher_swiginit(self, _otmeshing.new_ConvexDecompositionMesher(*args))
321
+ __swig_destroy__ = _otmeshing.delete_ConvexDecompositionMesher
322
+
323
+ # Register ConvexDecompositionMesher in _otmeshing:
324
+ _otmeshing.ConvexDecompositionMesher_swigregister(ConvexDecompositionMesher)
325
+ class _MeshCollection(object):
326
+ r"""
327
+ Collection.
328
+
329
+ Examples
330
+ --------
331
+ >>> import openturns as ot
332
+
333
+ - Collection of **real values**:
334
+
335
+ >>> ot.ScalarCollection(2)
336
+ [0,0]
337
+ >>> ot.ScalarCollection(2, 3.25)
338
+ [3.25,3.25]
339
+ >>> vector = ot.ScalarCollection([2.0, 1.5, 2.6])
340
+ >>> vector
341
+ [2,1.5,2.6]
342
+ >>> vector[1] = 4.2
343
+ >>> vector
344
+ [2,4.2,2.6]
345
+ >>> vector.add(3.8)
346
+ >>> vector
347
+ [2,4.2,2.6,3.8]
348
+
349
+ - Collection of **complex values**:
350
+
351
+ >>> ot.ComplexCollection(2)
352
+ [(0,0),(0,0)]
353
+ >>> ot.ComplexCollection(2, 3+4j)
354
+ [(3,4),(3,4)]
355
+ >>> vector = ot.ComplexCollection([2+3j, 1-4j, 3.0])
356
+ >>> vector
357
+ [(2,3),(1,-4),(3,0)]
358
+ >>> vector[1] = 4+3j
359
+ >>> vector
360
+ [(2,3),(4,3),(3,0)]
361
+ >>> vector.add(5+1j)
362
+ >>> vector
363
+ [(2,3),(4,3),(3,0),(5,1)]
364
+
365
+ - Collection of **booleans**:
366
+
367
+ >>> ot.BoolCollection(3)
368
+ [0,0,0]
369
+ >>> ot.BoolCollection(3, 1)
370
+ [1,1,1]
371
+ >>> vector = ot.BoolCollection([0, 1, 0])
372
+ >>> vector
373
+ [0,1,0]
374
+ >>> vector[1] = 0
375
+ >>> vector
376
+ [0,0,0]
377
+ >>> vector.add(1)
378
+ >>> vector
379
+ [0,0,0,1]
380
+
381
+ - Collection of **distributions**:
382
+
383
+ >>> print(ot.DistributionCollection(2))
384
+ [Uniform(a = -1, b = 1),Uniform(a = -1, b = 1)]
385
+ >>> print(ot.DistributionCollection(2, ot.Gamma(2.75, 1.0)))
386
+ [Gamma(k = 2.75, lambda = 1, gamma = 0),Gamma(k = 2.75, lambda = 1, gamma = 0)]
387
+ >>> vector = ot.DistributionCollection([ot.Normal(), ot.Uniform()])
388
+ >>> print(vector)
389
+ [Normal(mu = 0, sigma = 1),Uniform(a = -1, b = 1)]
390
+ >>> vector[1] = ot.Uniform(-0.5, 1)
391
+ >>> print(vector)
392
+ [Normal(mu = 0, sigma = 1),Uniform(a = -0.5, b = 1)]
393
+ >>> vector.add(ot.Gamma(2.75, 1.0))
394
+ >>> print(vector)
395
+ [Normal(mu = 0, sigma = 1),Uniform(a = -0.5, b = 1),Gamma(k = 2.75, lambda = 1, gamma = 0)]
396
+ """
397
+
398
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
399
+ __swig_destroy__ = _otmeshing.delete__MeshCollection
400
+
401
+ def clear(self):
402
+ r"""
403
+ Reset the collection to zero dimension.
404
+
405
+ Examples
406
+ --------
407
+ >>> import openturns as ot
408
+ >>> x = ot.Point(2)
409
+ >>> x.clear()
410
+ >>> x
411
+ class=Point name=Unnamed dimension=0 values=[]
412
+ """
413
+ return _otmeshing._MeshCollection_clear(self)
414
+
415
+ def __len__(self):
416
+ return _otmeshing._MeshCollection___len__(self)
417
+
418
+ def __eq__(self, rhs):
419
+ return _otmeshing._MeshCollection___eq__(self, rhs)
420
+
421
+ def __contains__(self, val):
422
+ return _otmeshing._MeshCollection___contains__(self, val)
423
+
424
+ def select(self, marginalIndices):
425
+ r"""
426
+ Selection from indices.
427
+
428
+ Parameters
429
+ ----------
430
+ indices : sequence of int
431
+ Indices to select
432
+
433
+ Returns
434
+ -------
435
+ coll : sequence
436
+ Sub-collection of values at the selection indices.
437
+ """
438
+ return _otmeshing._MeshCollection_select(self, marginalIndices)
439
+
440
+ def __getitem__(self, i):
441
+ return _otmeshing._MeshCollection___getitem__(self, i)
442
+
443
+ def __setitem__(self, i, val):
444
+ return _otmeshing._MeshCollection___setitem__(self, i, val)
445
+
446
+ def __delitem__(self, i):
447
+ return _otmeshing._MeshCollection___delitem__(self, i)
448
+
449
+ def at(self, *args):
450
+ r"""
451
+ Access to an element of the collection.
452
+
453
+ Parameters
454
+ ----------
455
+ index : positive int
456
+ Position of the element to access.
457
+
458
+ Returns
459
+ -------
460
+ element : type depends on the type of the collection
461
+ Element of the collection at the position *index*.
462
+ """
463
+ return _otmeshing._MeshCollection_at(self, *args)
464
+
465
+ def add(self, *args):
466
+ r"""
467
+ Append a component (in-place).
468
+
469
+ Parameters
470
+ ----------
471
+ value : type depends on the type of the collection.
472
+ The component to append.
473
+
474
+ Examples
475
+ --------
476
+ >>> import openturns as ot
477
+ >>> x = ot.Point(2)
478
+ >>> x.add(1.)
479
+ >>> print(x)
480
+ [0,0,1]
481
+ """
482
+ return _otmeshing._MeshCollection_add(self, *args)
483
+
484
+ def getSize(self):
485
+ r"""
486
+ Get the collection's dimension (or size).
487
+
488
+ Returns
489
+ -------
490
+ n : int
491
+ The number of components in the collection.
492
+ """
493
+ return _otmeshing._MeshCollection_getSize(self)
494
+
495
+ def resize(self, newSize):
496
+ r"""
497
+ Change the size of the collection.
498
+
499
+ Parameters
500
+ ----------
501
+ newSize : positive int
502
+ New size of the collection.
503
+
504
+ Notes
505
+ -----
506
+ If the new size is smaller than the older one, the last elements are thrown
507
+ away, else the new elements are set to the default value of the element type.
508
+
509
+ Examples
510
+ --------
511
+ >>> import openturns as ot
512
+ >>> x = ot.Point(2, 4)
513
+ >>> print(x)
514
+ [4,4]
515
+ >>> x.resize(1)
516
+ >>> print(x)
517
+ [4]
518
+ >>> x.resize(4)
519
+ >>> print(x)
520
+ [4,0,0,0]
521
+ """
522
+ return _otmeshing._MeshCollection_resize(self, newSize)
523
+
524
+ def isEmpty(self):
525
+ r"""
526
+ Tell if the collection is empty.
527
+
528
+ Returns
529
+ -------
530
+ isEmpty : bool
531
+ *True* if there is no element in the collection.
532
+
533
+ Examples
534
+ --------
535
+ >>> import openturns as ot
536
+ >>> x = ot.Point(2)
537
+ >>> x.isEmpty()
538
+ False
539
+ >>> x.clear()
540
+ >>> x.isEmpty()
541
+ True
542
+ """
543
+ return _otmeshing._MeshCollection_isEmpty(self)
544
+
545
+ def find(self, val):
546
+ return _otmeshing._MeshCollection_find(self, val)
547
+
548
+ def __repr__(self):
549
+ return _otmeshing._MeshCollection___repr__(self)
550
+
551
+ def __str__(self, *args):
552
+ return _otmeshing._MeshCollection___str__(self, *args)
553
+
554
+ def index(self, value):
555
+ r"""
556
+ Find the index of a given value.
557
+
558
+ Parameters
559
+ ----------
560
+ val : collection value type
561
+ The value to find
562
+
563
+ Returns
564
+ -------
565
+ index : int
566
+ The index of the first occurrence of the value.
567
+ Throws when the value is not found.
568
+ """
569
+ return _otmeshing._MeshCollection_index(self, value)
570
+
571
+ def __init__(self, *args):
572
+ _otmeshing._MeshCollection_swiginit(self, _otmeshing.new__MeshCollection(*args))
573
+
574
+ # Register _MeshCollection in _otmeshing:
575
+ _otmeshing._MeshCollection_swigregister(_MeshCollection)
576
+ class Cylinder(openturns.common.PersistentObject):
577
+ r"""
578
+ Generalized cylinder.
579
+
580
+ Parameters
581
+ ----------
582
+ base : :py:class:`openturns.Mesh`
583
+ Cylinder base
584
+ extension : :py:class:`openturns.Interval`
585
+ Extension range
586
+ injection : sequence of int
587
+ Dimension indices of the extension
588
+ discretization : int
589
+ Discretization number along dimensions of the extension
590
+
591
+ Examples
592
+ --------
593
+ Create a cylinder with an octogonal base, extended in the z-axis over [0, 5]:
594
+
595
+ >>> import otmeshing
596
+ >>> import openturns as ot
597
+ >>> import math
598
+ >>> polyline = []
599
+ >>> n = 8
600
+ >>> for i in range(n):
601
+ ... theta = i * 2.0 * math.pi / n
602
+ ... polyline.append([math.cos(theta), math.sin(theta)])
603
+ >>> base = otmeshing.PolygonMesher().build(polyline)
604
+ >>> extension = ot.Interval([0.0], [5.0]) # z-range
605
+ >>> injection = [2] # extension in the z-axis
606
+ >>> M = 4 # number of cells in the z-axis
607
+ >>> cylinder = otmeshing.Cylinder(base, extension, injection, M)
608
+ """
609
+
610
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
611
+
612
+ def getClassName(self):
613
+ r"""
614
+ Accessor to the object's name.
615
+
616
+ Returns
617
+ -------
618
+ class_name : str
619
+ The object class name (`object.__class__.__name__`).
620
+ """
621
+ return _otmeshing.Cylinder_getClassName(self)
622
+
623
+ def __init__(self, *args):
624
+ _otmeshing.Cylinder_swiginit(self, _otmeshing.new_Cylinder(*args))
625
+
626
+ def __repr__(self):
627
+ return _otmeshing.Cylinder___repr__(self)
628
+
629
+ def __str__(self, *args):
630
+ return _otmeshing.Cylinder___str__(self, *args)
631
+
632
+ def getBase(self):
633
+ r"""
634
+ Base accessor.
635
+
636
+ Returns
637
+ -------
638
+ base : :py:class:`openturns.Mesh`
639
+ Cylinder base
640
+ """
641
+ return _otmeshing.Cylinder_getBase(self)
642
+
643
+ def getExtension(self):
644
+ r"""
645
+ Extension accessor.
646
+
647
+ Returns
648
+ -------
649
+ extension : :py:class:`openturns.Interval`
650
+ Extension range
651
+ """
652
+ return _otmeshing.Cylinder_getExtension(self)
653
+
654
+ def getInjection(self):
655
+ r"""
656
+ Injection accessor.
657
+
658
+ Returns
659
+ -------
660
+ injection : :py:class:`openturns.Indices`
661
+ Dimension indices of the extension
662
+ """
663
+ return _otmeshing.Cylinder_getInjection(self)
664
+
665
+ def getDiscretization(self):
666
+ r"""
667
+ Discretization accessor.
668
+
669
+ Returns
670
+ -------
671
+ discretization : int
672
+ Discretization number along dimensions of the extension
673
+ """
674
+ return _otmeshing.Cylinder_getDiscretization(self)
675
+
676
+ def getVertices(self):
677
+ r"""
678
+ Vertices accessor.
679
+
680
+ Returns
681
+ -------
682
+ vertices : :py:class:`openturns.Sample`
683
+ Cylinder vertices.
684
+ """
685
+ return _otmeshing.Cylinder_getVertices(self)
686
+
687
+ def getBoundingBox(self):
688
+ r"""
689
+ Bounding box accessor.
690
+
691
+ Returns
692
+ -------
693
+ bbox : :py:class:`openturns.Interval`
694
+ Cylinder bounding box.
695
+ """
696
+ return _otmeshing.Cylinder_getBoundingBox(self)
697
+
698
+ def getVolume(self):
699
+ r"""
700
+ Volume accessor.
701
+
702
+ Returns
703
+ -------
704
+ volume : float
705
+ Cylinder volume.
706
+ """
707
+ return _otmeshing.Cylinder_getVolume(self)
708
+
709
+ def isConvex(self):
710
+ r"""
711
+ Convex property accessor.
712
+
713
+ Returns
714
+ -------
715
+ isConvex : bool
716
+ Convex property.
717
+ """
718
+ return _otmeshing.Cylinder_isConvex(self)
719
+
720
+ def getDimension(self):
721
+ r"""
722
+ Dimension accessor.
723
+
724
+ Returns
725
+ -------
726
+ dimension : int
727
+ Dimension
728
+ """
729
+ return _otmeshing.Cylinder_getDimension(self)
730
+
731
+ def computeMesh(self):
732
+ r"""
733
+ Build the mesh.
734
+
735
+ Returns
736
+ -------
737
+ mesh : :py:class:`openturns.Mesh`
738
+ Mesh of the cylinder
739
+ """
740
+ return _otmeshing.Cylinder_computeMesh(self)
741
+ __swig_destroy__ = _otmeshing.delete_Cylinder
742
+
743
+ # Register Cylinder in _otmeshing:
744
+ _otmeshing.Cylinder_swigregister(Cylinder)
745
+ class FunctionGraphMesher(openturns.common.PersistentObject):
746
+ r"""
747
+ Function meshing algorithm.
748
+
749
+ Examples
750
+ --------
751
+ >>> import openturns as ot
752
+ >>> import otmeshing
753
+ >>> bbox = ot.Interval([-8] * 2, [8] * 2)
754
+ >>> inputDiscretization = [10] * 2
755
+ >>> mesher = otmeshing.FunctionGraphMesher(bbox, inputDiscretization)
756
+ >>> f = ot.SymbolicFunction(['x', 'y'], ['cos(x) * sin(y)'])
757
+ >>> zIndex = 2 # z axis index
758
+ >>> zMin, zMax = 0.01, 0.3 # clip f in [0.01, 0.3]
759
+ >>> mesh = mesher.build(f, zIndex, zMin, zMax)
760
+ """
761
+
762
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
763
+
764
+ def getClassName(self):
765
+ r"""
766
+ Accessor to the object's name.
767
+
768
+ Returns
769
+ -------
770
+ class_name : str
771
+ The object class name (`object.__class__.__name__`).
772
+ """
773
+ return _otmeshing.FunctionGraphMesher_getClassName(self)
774
+
775
+ def __init__(self, *args):
776
+ _otmeshing.FunctionGraphMesher_swiginit(self, _otmeshing.new_FunctionGraphMesher(*args))
777
+
778
+ def __repr__(self):
779
+ return _otmeshing.FunctionGraphMesher___repr__(self)
780
+
781
+ def __str__(self, *args):
782
+ return _otmeshing.FunctionGraphMesher___str__(self, *args)
783
+
784
+ def build(self, function, outputIndex, minOutput, maxOutput, outputDiscretization=1, subGraph=True):
785
+ r"""
786
+ Generate a mesh from function discretization.
787
+
788
+ Parameters
789
+ ----------
790
+ function : :py:class:`openturns.Function`
791
+ Surface function, of output dimension 1
792
+ outputIndex : int
793
+ Index of the output variable
794
+ minOutput : float
795
+ Minimum output value
796
+ maxOutput : float
797
+ Maximum output value
798
+ outputDiscretization : int, optional
799
+ Number of discretizations along the output axis (default=1)
800
+ subGraph : bool, optional
801
+ Whether to mesh below or above the surface (default=True: below)
802
+
803
+ Returns
804
+ -------
805
+ mesh : :py:class:`openturns.Mesh`
806
+ The mesh generated.
807
+ """
808
+ return _otmeshing.FunctionGraphMesher_build(self, function, outputIndex, minOutput, maxOutput, outputDiscretization, subGraph)
809
+ __swig_destroy__ = _otmeshing.delete_FunctionGraphMesher
810
+
811
+ # Register FunctionGraphMesher in _otmeshing:
812
+ _otmeshing.FunctionGraphMesher_swigregister(FunctionGraphMesher)
813
+ class IntersectionMesher(openturns.common.PersistentObject):
814
+ r"""
815
+ Intersection meshing algorithm.
816
+
817
+ Examples
818
+ --------
819
+ Triangulate a parallelogram:
820
+
821
+ >>> import otmeshing
822
+ >>> import openturns as ot
823
+ >>> mesher = otmeshing.IntersectionMesher()
824
+ >>> dim = 2
825
+ >>> mesh1 = ot.IntervalMesher([1] * dim).build(ot.Interval([0.0] * dim, [3.0] * dim))
826
+ >>> mesh2 = ot.IntervalMesher([1] * dim).build(ot.Interval([1.0] * dim, [4.0] * dim))
827
+ >>> intersection = mesher.build([mesh1, mesh2]) # doctest: +SKIP
828
+
829
+ """
830
+
831
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
832
+
833
+ def getClassName(self):
834
+ r"""
835
+ Accessor to the object's name.
836
+
837
+ Returns
838
+ -------
839
+ class_name : str
840
+ The object class name (`object.__class__.__name__`).
841
+ """
842
+ return _otmeshing.IntersectionMesher_getClassName(self)
843
+
844
+ def __init__(self):
845
+ _otmeshing.IntersectionMesher_swiginit(self, _otmeshing.new_IntersectionMesher())
846
+
847
+ def __repr__(self):
848
+ return _otmeshing.IntersectionMesher___repr__(self)
849
+
850
+ def __str__(self, *args):
851
+ return _otmeshing.IntersectionMesher___str__(self, *args)
852
+
853
+ def build(self, coll):
854
+ r"""
855
+ Generate the mesh of the intersection.
856
+
857
+ Parameters
858
+ ----------
859
+ coll : sequence of :py:class:`openturns.Mesh`
860
+ Input meshes.
861
+
862
+ Returns
863
+ -------
864
+ mesh : :py:class:`openturns.Mesh`
865
+ The mesh of the intersection.
866
+ """
867
+ return _otmeshing.IntersectionMesher_build(self, coll)
868
+
869
+ def buildWithConvexParts(self, mesh, convexPieces):
870
+ r"""
871
+ Generate the mesh of the intersection of a mesh with pre-decomposed convex pieces.
872
+
873
+ Parameters
874
+ ----------
875
+ mesh : :py:class:`openturns.Mesh`
876
+ The first mesh, to be internally decomposed into convex parts.
877
+ convexPieces : sequence of :py:class:`openturns.Sample`
878
+ Pre-decomposed convex vertex sets for the second operand, e.g. from :meth:`buildCylinderConvex`.
879
+
880
+ Returns
881
+ -------
882
+ mesh : :py:class:`openturns.Mesh`
883
+ The mesh of the intersection.
884
+ """
885
+ return _otmeshing.IntersectionMesher_buildWithConvexParts(self, mesh, convexPieces)
886
+
887
+ def buildConvex(self, coll):
888
+ r"""
889
+ Generate the mesh of the intersection of convexes.
890
+
891
+ Parameters
892
+ ----------
893
+ coll : sequence of :py:class:`openturns.Mesh`
894
+ Input convex meshes.
895
+
896
+ Returns
897
+ -------
898
+ mesh : :py:class:`openturns.Mesh`
899
+ The mesh of the intersection.
900
+ """
901
+ return _otmeshing.IntersectionMesher_buildConvex(self, coll)
902
+
903
+ def buildConvexSample(self, coll):
904
+ r"""
905
+ Generate the vertices of the intersection of convexes.
906
+
907
+ Parameters
908
+ ----------
909
+ coll : sequence of :py:class:`openturns.Sample`
910
+ Input convex vertices.
911
+
912
+ Returns
913
+ -------
914
+ vertices : :py:class:`openturns.Sample`
915
+ The vertices of the intersection.
916
+ """
917
+ return _otmeshing.IntersectionMesher_buildConvexSample(self, coll)
918
+
919
+ def buildCylinder(self, coll):
920
+ r"""
921
+ Generate the mesh of the intersection of cylinders.
922
+
923
+ Parameters
924
+ ----------
925
+ coll : sequence of :class:`~otmeshing.Cylinder`
926
+ Input cylinders.
927
+
928
+ Returns
929
+ -------
930
+ mesh : :py:class:`openturns.Mesh`
931
+ The mesh of the intersection.
932
+ """
933
+ return _otmeshing.IntersectionMesher_buildCylinder(self, coll)
934
+
935
+ def buildCylinderConvex(self, coll):
936
+ r"""
937
+ Generate the convex decomposition of the intersection of cylinders.
938
+
939
+ Parameters
940
+ ----------
941
+ coll : sequence of :class:`~otmeshing.Cylinder`
942
+ Input cylinders.
943
+
944
+ Returns
945
+ -------
946
+ pieces : sequence of :py:class:`openturns.Sample`
947
+ Convex vertex sets representing the intersection, suitable for use with :meth:`build`.
948
+ """
949
+ return _otmeshing.IntersectionMesher_buildCylinderConvex(self, coll)
950
+
951
+ def setRecompress(self, recompress):
952
+ r"""
953
+ Recompression flag accessor.
954
+
955
+ Parameters
956
+ ----------
957
+ recompress : bool
958
+ Whether to eliminate duplicate vertices.
959
+
960
+ """
961
+ return _otmeshing.IntersectionMesher_setRecompress(self, recompress)
962
+
963
+ def getRecompress(self):
964
+ r"""
965
+ Recompression flag accessor.
966
+
967
+ Returns
968
+ -------
969
+ recompress : bool
970
+ Whether to eliminate duplicate vertices.
971
+
972
+ """
973
+ return _otmeshing.IntersectionMesher_getRecompress(self)
974
+
975
+ def setUseSimplicesDecomposition(self, useSimplicesDecomposition):
976
+ r"""
977
+ Simplicial decomposition flag accessor.
978
+
979
+ Parameters
980
+ ----------
981
+ useSimplicesDecomposition : bool
982
+ Whether to decompose the mesh by its simplices.
983
+
984
+ """
985
+ return _otmeshing.IntersectionMesher_setUseSimplicesDecomposition(self, useSimplicesDecomposition)
986
+
987
+ def getUseSimplicesDecomposition(self):
988
+ r"""
989
+ Simplicial decomposition flag accessor.
990
+
991
+ Returns
992
+ -------
993
+ useSimplicesDecomposition : bool
994
+ Whether to decompose the mesh by its simplices.
995
+
996
+ """
997
+ return _otmeshing.IntersectionMesher_getUseSimplicesDecomposition(self)
998
+ __swig_destroy__ = _otmeshing.delete_IntersectionMesher
999
+
1000
+ # Register IntersectionMesher in _otmeshing:
1001
+ _otmeshing.IntersectionMesher_swigregister(IntersectionMesher)
1002
+ class MeshDomain2(openturns.algo.MeshDomain):
1003
+ r"""
1004
+ Adaptor to convert a Mesh to a Domain, with signed distance.
1005
+
1006
+ Parameters
1007
+ ----------
1008
+ mesh : :class:`~openturns.Mesh`
1009
+ Underlying mesh.
1010
+
1011
+ Examples
1012
+ --------
1013
+ Compute the distance from a point to a domain defined from
1014
+ the mesh of the unit square
1015
+
1016
+ >>> import otmeshing
1017
+ >>> import openturns as ot
1018
+ >>> dim = 2
1019
+ >>> mesh = ot.IntervalMesher([1] * dim).build(ot.Interval(dim))
1020
+ >>> domain = otmeshing.MeshDomain2(mesh)
1021
+ >>> p = [5.0] * dim
1022
+ >>> distance = domain.computeDistance(p)
1023
+
1024
+ """
1025
+
1026
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1027
+ __repr__ = _swig_repr
1028
+
1029
+ def getClassName(self):
1030
+ r"""
1031
+ Accessor to the object's name.
1032
+
1033
+ Returns
1034
+ -------
1035
+ class_name : str
1036
+ The object class name (`object.__class__.__name__`).
1037
+ """
1038
+ return _otmeshing.MeshDomain2_getClassName(self)
1039
+
1040
+ def __init__(self, *args):
1041
+ _otmeshing.MeshDomain2_swiginit(self, _otmeshing.new_MeshDomain2(*args))
1042
+
1043
+ def computeDistance(self, *args):
1044
+ r"""
1045
+ Compute the Euclidean distance of a given point to the domain.
1046
+
1047
+ Parameters
1048
+ ----------
1049
+ point or sample : sequence of float or 2-d sequence of float
1050
+ Point or Sample with the same dimension as the current domain's dimension.
1051
+
1052
+ Returns
1053
+ -------
1054
+ distance : float or Sample
1055
+ Euclidean distance of the point to the domain.
1056
+ """
1057
+ return _otmeshing.MeshDomain2_computeDistance(self, *args)
1058
+ __swig_destroy__ = _otmeshing.delete_MeshDomain2
1059
+
1060
+ # Register MeshDomain2 in _otmeshing:
1061
+ _otmeshing.MeshDomain2_swigregister(MeshDomain2)
1062
+ class PolygonMesher(openturns.common.PersistentObject):
1063
+ r"""
1064
+ 2-d Polygon meshing algorithm.
1065
+
1066
+ Examples
1067
+ --------
1068
+ Triangulate a parallelogram:
1069
+
1070
+ >>> import otmeshing
1071
+ >>> mesher = otmeshing.PolygonMesher()
1072
+ >>> polyline = [[0, 0], [3, 0], [4, 2], [1, 2]]
1073
+ >>> triangulation = mesher.build(polyline)
1074
+ """
1075
+
1076
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1077
+
1078
+ def getClassName(self):
1079
+ r"""
1080
+ Accessor to the object's name.
1081
+
1082
+ Returns
1083
+ -------
1084
+ class_name : str
1085
+ The object class name (`object.__class__.__name__`).
1086
+ """
1087
+ return _otmeshing.PolygonMesher_getClassName(self)
1088
+
1089
+ def __init__(self):
1090
+ _otmeshing.PolygonMesher_swiginit(self, _otmeshing.new_PolygonMesher())
1091
+
1092
+ def __repr__(self):
1093
+ return _otmeshing.PolygonMesher___repr__(self)
1094
+
1095
+ def __str__(self, *args):
1096
+ return _otmeshing.PolygonMesher___str__(self, *args)
1097
+
1098
+ def build(self, points):
1099
+ r"""
1100
+ Generate a mesh from polygon coordinates.
1101
+
1102
+ Parameters
1103
+ ----------
1104
+ polyline : :py:class:`openturns.Sample`
1105
+ An ordered set of vertices defining a 2-d polygon, possibly non-convex.
1106
+ The polygon must be simple (with no redundant vertex).
1107
+ The vertices can be of dimension greater than 2,
1108
+ but the polygon itsef should be within a single plane.
1109
+
1110
+ Returns
1111
+ -------
1112
+ mesh : :py:class:`openturns.Mesh`
1113
+ The triangulation generated.
1114
+ """
1115
+ return _otmeshing.PolygonMesher_build(self, points)
1116
+ __swig_destroy__ = _otmeshing.delete_PolygonMesher
1117
+
1118
+ # Register PolygonMesher in _otmeshing:
1119
+ _otmeshing.PolygonMesher_swigregister(PolygonMesher)
1120
+ class UnionMesher(openturns.common.PersistentObject):
1121
+ r"""
1122
+ Union of disjoint meshes.
1123
+
1124
+ Examples
1125
+ --------
1126
+ >>> import openturns as ot
1127
+ >>> import otmeshing
1128
+ >>> mesher = otmeshing.UnionMesher()
1129
+ >>> dim = 2
1130
+ >>> mesh1 = ot.IntervalMesher([1] * dim).build(ot.Interval(dim))
1131
+ >>> mesh2 = ot.IntervalMesher([1] * dim).build(ot.Interval([2.0] * dim, [3.0] * dim))
1132
+ >>> union = mesher.build([mesh1, mesh2])
1133
+ """
1134
+
1135
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1136
+
1137
+ def getClassName(self):
1138
+ r"""
1139
+ Accessor to the object's name.
1140
+
1141
+ Returns
1142
+ -------
1143
+ class_name : str
1144
+ The object class name (`object.__class__.__name__`).
1145
+ """
1146
+ return _otmeshing.UnionMesher_getClassName(self)
1147
+
1148
+ def __init__(self):
1149
+ _otmeshing.UnionMesher_swiginit(self, _otmeshing.new_UnionMesher())
1150
+
1151
+ def __repr__(self):
1152
+ return _otmeshing.UnionMesher___repr__(self)
1153
+
1154
+ def __str__(self, *args):
1155
+ return _otmeshing.UnionMesher___str__(self, *args)
1156
+
1157
+ def build(self, coll):
1158
+ r"""
1159
+ Generate a mesh from the union of disjoint meshes.
1160
+
1161
+ Parameters
1162
+ ----------
1163
+ coll : sequence of :py:class:`openturns.Mesh`
1164
+ Non-overlapping meshes.
1165
+
1166
+ Returns
1167
+ -------
1168
+ mesh : :py:class:`openturns.Mesh`
1169
+ The mesh of the union.
1170
+ """
1171
+ return _otmeshing.UnionMesher_build(self, coll)
1172
+
1173
+ @staticmethod
1174
+ def CompressMesh(mesh):
1175
+ r"""
1176
+ Deduplicate mesh vertices.
1177
+
1178
+ A k-D tree radius search is used to filter out duplicate vertices.
1179
+
1180
+ Parameters
1181
+ ----------
1182
+ mesh : :py:class:`openturns.Mesh`
1183
+ A mesh.
1184
+
1185
+ Returns
1186
+ -------
1187
+ compressedMesh : :py:class:`openturns.Mesh`
1188
+ The crompressed mesh.
1189
+
1190
+ """
1191
+ return _otmeshing.UnionMesher_CompressMesh(mesh)
1192
+ __swig_destroy__ = _otmeshing.delete_UnionMesher
1193
+
1194
+ # Register UnionMesher in _otmeshing:
1195
+ _otmeshing.UnionMesher_swigregister(UnionMesher)
1196
+ class VolumeMesher(openturns.common.PersistentObject):
1197
+ r"""
1198
+ Build a volume mesh from a surface mesh.
1199
+
1200
+ Tetrahedralizes a closed triangular surface mesh by creating a fan of
1201
+ tetrahedra from an apex vertex to each boundary triangle.
1202
+
1203
+ """
1204
+
1205
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1206
+
1207
+ def getClassName(self):
1208
+ r"""
1209
+ Accessor to the object's name.
1210
+
1211
+ Returns
1212
+ -------
1213
+ class_name : str
1214
+ The object class name (`object.__class__.__name__`).
1215
+ """
1216
+ return _otmeshing.VolumeMesher_getClassName(self)
1217
+ CENTROID = _otmeshing.VolumeMesher_CENTROID
1218
+ FIRST_VERTEX = _otmeshing.VolumeMesher_FIRST_VERTEX
1219
+
1220
+ def build(self, surface):
1221
+ r"""
1222
+ Build a volume mesh from a surface mesh.
1223
+
1224
+ Parameters
1225
+ ----------
1226
+ surface : :class:`~openturns.Mesh`
1227
+ A surface mesh (triangles in dimension 3).
1228
+
1229
+ Returns
1230
+ -------
1231
+ volume : :class:`~openturns.Mesh`
1232
+ A volume mesh (tetrahedra in dimension 3).
1233
+
1234
+ """
1235
+ return _otmeshing.VolumeMesher_build(self, surface)
1236
+
1237
+ def setApexStrategy(self, strategy):
1238
+ r"""
1239
+ Apex strategy accessor.
1240
+
1241
+ Parameters
1242
+ ----------
1243
+ strategy : int
1244
+ VolumeMesher.CENTROID or VolumeMesher.FIRSTVERTEX.
1245
+
1246
+ """
1247
+ return _otmeshing.VolumeMesher_setApexStrategy(self, strategy)
1248
+
1249
+ def getApexStrategy(self):
1250
+ r"""
1251
+ Apex strategy accessor.
1252
+
1253
+ Returns
1254
+ -------
1255
+ strategy : int
1256
+ VolumeMesher.CENTROID or VolumeMesher.FIRSTVERTEX.
1257
+
1258
+ """
1259
+ return _otmeshing.VolumeMesher_getApexStrategy(self)
1260
+
1261
+ def __repr__(self):
1262
+ return _otmeshing.VolumeMesher___repr__(self)
1263
+
1264
+ def __init__(self, *args):
1265
+ _otmeshing.VolumeMesher_swiginit(self, _otmeshing.new_VolumeMesher(*args))
1266
+ __swig_destroy__ = _otmeshing.delete_VolumeMesher
1267
+
1268
+ # Register VolumeMesher in _otmeshing:
1269
+ _otmeshing.VolumeMesher_swigregister(VolumeMesher)
1270
+
@@ -0,0 +1,19 @@
1
+ Metadata-Version: 1.2
2
+ Name: otmeshing
3
+ Version: 0.2dev0
4
+ Summary: Meshing module
5
+ Home-page: http://www.openturns.org
6
+ Author: OpenTURNS Developers
7
+ Author-email: users@openturns.org
8
+ License: LGPL
9
+ Keywords: probability reliability sensitivity metamodel
10
+ Platform: any
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
13
+ Classifier: Programming Language :: C++
14
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
15
+ Classifier: Intended Audience :: Science/Research
16
+ Requires-Dist: openturns (>=1.20)
17
+
18
+ Meshing module for OpenTURNS
19
+ It provides mesh intersection, convex decomposition etc
@@ -0,0 +1,11 @@
1
+ otmeshing-0.2dev0.dist-info/METADATA,sha256=oZRQsDKuL4W9TMak1V7T5E1b-rstuUDKHbOcghjs0Y0,682
2
+ otmeshing-0.2dev0.dist-info/WHEEL,sha256=BMraOaMe_VaVqUbhxgZ6LABQPl0iQ1n5hRY4Ab8wbZc,85
3
+ otmeshing-0.2dev0.dist-info/RECORD,,
4
+ otmeshing/libotmeshing.dll,sha256=7M-VuGpzriiApI7dyYn3IM7X-zzMkIH3Rp4zjGv_8Y4,2779648
5
+ otmeshing/libcdd-0.dll,sha256=SiEB4QZnxV7uTqyMdf1Kf-nq_e3wqPSHYspsyMbYwn4,129612
6
+ otmeshing/_otmeshing.pyd,sha256=Ln8KIsS7D-22lcCEbFyGvNuiY4XUiuVIc5aHCO5BEmQ,683520
7
+ otmeshing/libqhull_r.dll,sha256=kYMzRLfSzVTa8oXn-vAEQVr-IGdBtn3CUY6-ewPyeBs,498272
8
+ otmeshing/otmeshing.py,sha256=LjQkwWrhSSbtB6kAU9Y-DbKG6VCDxKewMU3PYSY26rE,35988
9
+ otmeshing/lib_coacd.dll,sha256=P4Tt-WDyUvs-PM4EFY6QIu4goX0qRuqs0EjvvKZsoqg,1262381
10
+ otmeshing/libcddgmp-0.dll,sha256=xr-LpGKlJOxXBNuKuf6rf9DrSJVKyJ4LxTuPFJLejc0,249222
11
+ otmeshing/__init__.py,sha256=IObjf0BwzXDauDGCl7AC0COX_yngR7BYnqa6BDeESrw,294
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: custom
3
+ Root-Is-Purelib: false
4
+ Tag: cp39-abi3-win_amd64