capytaine 2.3.1__cp314-cp314-macosx_14_0_arm64.whl → 3.0.0a1__cp314-cp314-macosx_14_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.
- capytaine/__about__.py +7 -2
- capytaine/__init__.py +8 -12
- capytaine/bem/engines.py +234 -354
- capytaine/bem/problems_and_results.py +14 -13
- capytaine/bem/solver.py +204 -80
- capytaine/bodies/bodies.py +278 -869
- capytaine/bodies/dofs.py +136 -9
- capytaine/bodies/hydrostatics.py +540 -0
- capytaine/bodies/multibodies.py +216 -0
- capytaine/green_functions/{libs/Delhommeau_float32.cpython-314-darwin.so → Delhommeau_float32.cpython-314-darwin.so} +0 -0
- capytaine/green_functions/{libs/Delhommeau_float64.cpython-314-darwin.so → Delhommeau_float64.cpython-314-darwin.so} +0 -0
- capytaine/green_functions/abstract_green_function.py +2 -2
- capytaine/green_functions/delhommeau.py +31 -16
- capytaine/green_functions/hams.py +19 -13
- capytaine/io/legacy.py +3 -103
- capytaine/io/xarray.py +11 -6
- capytaine/meshes/__init__.py +2 -6
- capytaine/meshes/abstract_meshes.py +375 -0
- capytaine/meshes/clean.py +302 -0
- capytaine/meshes/clip.py +347 -0
- capytaine/meshes/export.py +89 -0
- capytaine/meshes/geometry.py +244 -394
- capytaine/meshes/io.py +433 -0
- capytaine/meshes/meshes.py +617 -681
- capytaine/meshes/predefined/cylinders.py +22 -56
- capytaine/meshes/predefined/rectangles.py +26 -85
- capytaine/meshes/predefined/spheres.py +4 -11
- capytaine/meshes/quality.py +118 -407
- capytaine/meshes/surface_integrals.py +48 -29
- capytaine/meshes/symmetric_meshes.py +641 -0
- capytaine/meshes/visualization.py +353 -0
- capytaine/post_pro/free_surfaces.py +1 -4
- capytaine/post_pro/kochin.py +10 -10
- capytaine/tools/block_circulant_matrices.py +275 -0
- capytaine/tools/lists_of_points.py +2 -2
- capytaine/tools/memory_monitor.py +45 -0
- capytaine/tools/symbolic_multiplication.py +13 -1
- capytaine/tools/timer.py +58 -34
- {capytaine-2.3.1.dist-info → capytaine-3.0.0a1.dist-info}/METADATA +7 -2
- capytaine-3.0.0a1.dist-info/RECORD +65 -0
- capytaine/bodies/predefined/__init__.py +0 -6
- capytaine/bodies/predefined/cylinders.py +0 -151
- capytaine/bodies/predefined/rectangles.py +0 -111
- capytaine/bodies/predefined/spheres.py +0 -70
- capytaine/green_functions/FinGreen3D/.gitignore +0 -1
- capytaine/green_functions/FinGreen3D/FinGreen3D.f90 +0 -3589
- capytaine/green_functions/FinGreen3D/LICENSE +0 -165
- capytaine/green_functions/FinGreen3D/Makefile +0 -16
- capytaine/green_functions/FinGreen3D/README.md +0 -24
- capytaine/green_functions/FinGreen3D/test_program.f90 +0 -39
- capytaine/green_functions/LiangWuNoblesse/.gitignore +0 -1
- capytaine/green_functions/LiangWuNoblesse/LICENSE +0 -504
- capytaine/green_functions/LiangWuNoblesse/LiangWuNoblesseWaveTerm.f90 +0 -751
- capytaine/green_functions/LiangWuNoblesse/Makefile +0 -16
- capytaine/green_functions/LiangWuNoblesse/README.md +0 -2
- capytaine/green_functions/LiangWuNoblesse/test_program.f90 +0 -28
- capytaine/green_functions/libs/__init__.py +0 -0
- capytaine/io/mesh_loaders.py +0 -1086
- capytaine/io/mesh_writers.py +0 -692
- capytaine/io/meshio.py +0 -38
- capytaine/matrices/__init__.py +0 -16
- capytaine/matrices/block.py +0 -592
- capytaine/matrices/block_toeplitz.py +0 -325
- capytaine/matrices/builders.py +0 -89
- capytaine/matrices/linear_solvers.py +0 -232
- capytaine/matrices/low_rank.py +0 -395
- capytaine/meshes/clipper.py +0 -465
- capytaine/meshes/collections.py +0 -342
- capytaine/meshes/mesh_like_protocol.py +0 -37
- capytaine/meshes/properties.py +0 -276
- capytaine/meshes/quadratures.py +0 -80
- capytaine/meshes/symmetric.py +0 -462
- capytaine/tools/lru_cache.py +0 -49
- capytaine/ui/vtk/__init__.py +0 -3
- capytaine/ui/vtk/animation.py +0 -329
- capytaine/ui/vtk/body_viewer.py +0 -28
- capytaine/ui/vtk/helpers.py +0 -82
- capytaine/ui/vtk/mesh_viewer.py +0 -461
- capytaine-2.3.1.dist-info/RECORD +0 -92
- {capytaine-2.3.1.dist-info → capytaine-3.0.0a1.dist-info}/LICENSE +0 -0
- {capytaine-2.3.1.dist-info → capytaine-3.0.0a1.dist-info}/WHEEL +0 -0
- {capytaine-2.3.1.dist-info → capytaine-3.0.0a1.dist-info}/entry_points.txt +0 -0
capytaine/ui/vtk/mesh_viewer.py
DELETED
|
@@ -1,461 +0,0 @@
|
|
|
1
|
-
"""3D display of a mesh with VTK.
|
|
2
|
-
Based on meshmagick <https://github.com/LHEEA/meshmagick> by François Rongère.
|
|
3
|
-
"""
|
|
4
|
-
# Copyright (C) 2017-2019 Matthieu Ancellin, based on the work of François Rongère
|
|
5
|
-
# See LICENSE file at <https://github.com/mancellin/capytaine>
|
|
6
|
-
|
|
7
|
-
import datetime
|
|
8
|
-
from itertools import cycle
|
|
9
|
-
from os import getcwd
|
|
10
|
-
|
|
11
|
-
from capytaine.ui.vtk.helpers import compute_vtk_polydata
|
|
12
|
-
from capytaine.tools.optional_imports import import_optional_dependency
|
|
13
|
-
|
|
14
|
-
vtk = import_optional_dependency("vtk")
|
|
15
|
-
|
|
16
|
-
__year__ = datetime.datetime.now().year
|
|
17
|
-
|
|
18
|
-
COLORS = cycle([(1, 1, 0), (1, 0, 1), (1, 0, 0), (0, 1, 0), (0, 0, 1), (0, 1, 1)])
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class MeshViewer:
|
|
22
|
-
"""This class implements a viewer based on VTK"""
|
|
23
|
-
def __init__(self):
|
|
24
|
-
|
|
25
|
-
# Building renderer
|
|
26
|
-
self.renderer = vtk.vtkRenderer()
|
|
27
|
-
self.renderer.SetBackground(0.7706, 0.8165, 1.0)
|
|
28
|
-
|
|
29
|
-
# Building render window
|
|
30
|
-
self.render_window = vtk.vtkRenderWindow()
|
|
31
|
-
self.render_window.SetSize(1024, 768)
|
|
32
|
-
self.render_window.SetWindowName("Mesh viewer")
|
|
33
|
-
self.render_window.AddRenderer(self.renderer)
|
|
34
|
-
|
|
35
|
-
# Building interactor
|
|
36
|
-
self.render_window_interactor = vtk.vtkRenderWindowInteractor()
|
|
37
|
-
self.render_window_interactor.SetRenderWindow(self.render_window)
|
|
38
|
-
self.render_window_interactor.GetInteractorStyle().SetCurrentStyleToTrackballCamera()
|
|
39
|
-
self.render_window_interactor.AddObserver('KeyPressEvent', self.on_key_press, 0.0)
|
|
40
|
-
|
|
41
|
-
# Building axes view
|
|
42
|
-
axes = vtk.vtkAxesActor()
|
|
43
|
-
widget = vtk.vtkOrientationMarkerWidget()
|
|
44
|
-
widget.SetOrientationMarker(axes)
|
|
45
|
-
self.widget = widget
|
|
46
|
-
|
|
47
|
-
self.widget.SetInteractor(self.render_window_interactor)
|
|
48
|
-
self.widget.SetEnabled(1)
|
|
49
|
-
self.widget.InteractiveOn()
|
|
50
|
-
|
|
51
|
-
# Building command annotations
|
|
52
|
-
command_text = ("left mouse : rotate\n"
|
|
53
|
-
"right mouse : zoom\n"
|
|
54
|
-
"middle mouse : pan\n"
|
|
55
|
-
"ctrl+left mouse : spin\n"
|
|
56
|
-
"n : (un)show normals\n"
|
|
57
|
-
"b : (un)show axes box\n"
|
|
58
|
-
"f : focus on the mouse cursor\n"
|
|
59
|
-
"r : reset view\n"
|
|
60
|
-
"s : surface representation\n"
|
|
61
|
-
"w : wire representation\n"
|
|
62
|
-
"h : (un)show Oxy plane\n"
|
|
63
|
-
"x : save\n"
|
|
64
|
-
"c : screenshot\n"
|
|
65
|
-
"q : quit")
|
|
66
|
-
|
|
67
|
-
corner_annotation = vtk.vtkCornerAnnotation()
|
|
68
|
-
corner_annotation.SetLinearFontScaleFactor(2)
|
|
69
|
-
corner_annotation.SetNonlinearFontScaleFactor(1)
|
|
70
|
-
corner_annotation.SetMaximumFontSize(20)
|
|
71
|
-
corner_annotation.SetText(3, command_text)
|
|
72
|
-
corner_annotation.GetTextProperty().SetColor(0., 0., 0.)
|
|
73
|
-
self.renderer.AddViewProp(corner_annotation)
|
|
74
|
-
|
|
75
|
-
copyright_text = (f"Capytaine — Copyright 2017-{__year__} University College Dublin\n"
|
|
76
|
-
f"based on Meshmagick Viewer — Copyright 2014-{__year__}, École Centrale de Nantes")
|
|
77
|
-
|
|
78
|
-
copyright_annotation = vtk.vtkCornerAnnotation()
|
|
79
|
-
copyright_annotation.SetLinearFontScaleFactor(0.5)
|
|
80
|
-
copyright_annotation.SetNonlinearFontScaleFactor(1)
|
|
81
|
-
copyright_annotation.SetMaximumFontSize(12)
|
|
82
|
-
copyright_annotation.SetText(1, copyright_text)
|
|
83
|
-
copyright_annotation.GetTextProperty().SetColor(0., 0., 0.)
|
|
84
|
-
self.renderer.AddViewProp(copyright_annotation)
|
|
85
|
-
|
|
86
|
-
self.polydatas = []
|
|
87
|
-
self.normals = []
|
|
88
|
-
self.axes = []
|
|
89
|
-
self.oxy_plane = None
|
|
90
|
-
|
|
91
|
-
# DISPLAY OF A MESH
|
|
92
|
-
|
|
93
|
-
def add_polydata(self, polydata, color=(1, 1, 0), representation='surface'):
|
|
94
|
-
"""Add a polydata object to the viewer
|
|
95
|
-
|
|
96
|
-
Parameters
|
|
97
|
-
----------
|
|
98
|
-
polydata : vtkPolyData
|
|
99
|
-
the object to be added
|
|
100
|
-
color : array_like, optional
|
|
101
|
-
the color of the object. Default is yellow (1, 1, 0)
|
|
102
|
-
representation : str
|
|
103
|
-
the representation mode of the object ('surface' or 'wireframe'). Default is 'surface'.
|
|
104
|
-
"""
|
|
105
|
-
|
|
106
|
-
assert isinstance(polydata, vtk.vtkPolyData)
|
|
107
|
-
assert representation in ('surface', 'wireframe')
|
|
108
|
-
|
|
109
|
-
self.polydatas.append(polydata)
|
|
110
|
-
|
|
111
|
-
# Building mapper
|
|
112
|
-
mapper = vtk.vtkPolyDataMapper()
|
|
113
|
-
mapper.SetInputData(polydata)
|
|
114
|
-
|
|
115
|
-
# Building actor
|
|
116
|
-
actor = vtk.vtkActor()
|
|
117
|
-
actor.SetMapper(mapper)
|
|
118
|
-
|
|
119
|
-
# Properties setting
|
|
120
|
-
actor.GetProperty().SetColor(color)
|
|
121
|
-
actor.GetProperty().EdgeVisibilityOn()
|
|
122
|
-
actor.GetProperty().SetEdgeColor(0, 0, 0)
|
|
123
|
-
actor.GetProperty().SetLineWidth(1)
|
|
124
|
-
actor.GetProperty().SetPointSize(10)
|
|
125
|
-
if representation == 'wireframe':
|
|
126
|
-
actor.GetProperty().SetRepresentationToWireframe()
|
|
127
|
-
|
|
128
|
-
self.renderer.AddActor(actor)
|
|
129
|
-
self.renderer.Modified()
|
|
130
|
-
|
|
131
|
-
def add_mesh(self, mesh, color=None, representation='surface'):
|
|
132
|
-
vtk_polydata = compute_vtk_polydata(mesh)
|
|
133
|
-
if color is None:
|
|
134
|
-
color = next(COLORS)
|
|
135
|
-
self.add_polydata(vtk_polydata, color=color, representation=representation)
|
|
136
|
-
|
|
137
|
-
# ADD MORE DETAILS
|
|
138
|
-
|
|
139
|
-
def add_oxy_plane(self):
|
|
140
|
-
"""Displays the Oxy plane"""
|
|
141
|
-
|
|
142
|
-
one_mesh_in_the_viewer = self.polydatas[0]
|
|
143
|
-
|
|
144
|
-
plane = vtk.vtkPlaneSource()
|
|
145
|
-
(xmin, xmax, ymin, ymax, _, _) = one_mesh_in_the_viewer.GetBounds()
|
|
146
|
-
|
|
147
|
-
dx = max(0.1 * (xmax - xmin), 0.1)
|
|
148
|
-
dy = max(0.1 * (ymax - ymin), 0.1)
|
|
149
|
-
|
|
150
|
-
plane.SetOrigin(xmin - dx, ymax + dy, 0)
|
|
151
|
-
plane.SetPoint1(xmin - dx, ymin - dy, 0)
|
|
152
|
-
plane.SetPoint2(xmax + dx, ymax + dy, 0)
|
|
153
|
-
plane.Update()
|
|
154
|
-
polydata = plane.GetOutput()
|
|
155
|
-
|
|
156
|
-
mapper = vtk.vtkPolyDataMapper()
|
|
157
|
-
mapper.SetInputData(polydata)
|
|
158
|
-
|
|
159
|
-
actor = vtk.vtkActor()
|
|
160
|
-
actor.SetMapper(mapper)
|
|
161
|
-
|
|
162
|
-
color = [0., 102. / 255, 204. / 255]
|
|
163
|
-
actor.GetProperty().SetColor(color)
|
|
164
|
-
actor.GetProperty().SetEdgeColor(0, 0, 0)
|
|
165
|
-
actor.GetProperty().SetLineWidth(1)
|
|
166
|
-
|
|
167
|
-
self.renderer.AddActor(actor)
|
|
168
|
-
self.renderer.Modified()
|
|
169
|
-
self.oxy_plane = actor
|
|
170
|
-
|
|
171
|
-
def show_normals(self):
|
|
172
|
-
"""Shows the normals of the current objects"""
|
|
173
|
-
|
|
174
|
-
for polydata in self.polydatas:
|
|
175
|
-
normals = vtk.vtkPolyDataNormals()
|
|
176
|
-
normals.ConsistencyOff()
|
|
177
|
-
normals.ComputeCellNormalsOn()
|
|
178
|
-
normals.SetInputData(polydata)
|
|
179
|
-
normals.Update()
|
|
180
|
-
|
|
181
|
-
normals_at_centers = vtk.vtkCellCenters()
|
|
182
|
-
normals_at_centers.SetInputConnection(normals.GetOutputPort())
|
|
183
|
-
|
|
184
|
-
arrows = vtk.vtkArrowSource()
|
|
185
|
-
arrows.SetTipResolution(16)
|
|
186
|
-
arrows.SetTipLength(0.5)
|
|
187
|
-
arrows.SetTipRadius(0.1)
|
|
188
|
-
|
|
189
|
-
glyph = vtk.vtkGlyph3D()
|
|
190
|
-
glyph.SetSourceConnection(arrows.GetOutputPort())
|
|
191
|
-
glyph.SetInputConnection(normals_at_centers.GetOutputPort())
|
|
192
|
-
glyph.SetVectorModeToUseNormal()
|
|
193
|
-
glyph.SetScaleModeToScaleByVector()
|
|
194
|
-
glyph.SetScaleFactor(1) # FIXME: may be too big ...
|
|
195
|
-
# glyph.SetVectorModeToUseNormal()
|
|
196
|
-
# glyph.SetVectorModeToUseVector()
|
|
197
|
-
# glyph.SetScaleModeToDataScalingOff()
|
|
198
|
-
glyph.Update()
|
|
199
|
-
|
|
200
|
-
glyph_mapper = vtk.vtkPolyDataMapper()
|
|
201
|
-
glyph_mapper.SetInputConnection(glyph.GetOutputPort())
|
|
202
|
-
|
|
203
|
-
glyph_actor = vtk.vtkActor()
|
|
204
|
-
glyph_actor.SetMapper(glyph_mapper)
|
|
205
|
-
|
|
206
|
-
self.renderer.AddActor(glyph_actor)
|
|
207
|
-
self.normals.append(glyph_actor)
|
|
208
|
-
|
|
209
|
-
def show_axes(self):
|
|
210
|
-
"""Shows the axes around the main object"""
|
|
211
|
-
|
|
212
|
-
tprop = vtk.vtkTextProperty()
|
|
213
|
-
tprop.SetColor(0., 0., 0.)
|
|
214
|
-
tprop.ShadowOn()
|
|
215
|
-
|
|
216
|
-
axes = vtk.vtkCubeAxesActor2D()
|
|
217
|
-
axes.SetInputData(self.polydatas[0])
|
|
218
|
-
|
|
219
|
-
axes.SetCamera(self.renderer.GetActiveCamera())
|
|
220
|
-
axes.SetLabelFormat("%6.4g")
|
|
221
|
-
axes.SetFlyModeToOuterEdges()
|
|
222
|
-
axes.SetFontFactor(0.8)
|
|
223
|
-
axes.SetAxisTitleTextProperty(tprop)
|
|
224
|
-
axes.SetAxisLabelTextProperty(tprop)
|
|
225
|
-
# axes.DrawGridLinesOn()
|
|
226
|
-
|
|
227
|
-
self.renderer.AddViewProp(axes)
|
|
228
|
-
self.axes.append(axes)
|
|
229
|
-
|
|
230
|
-
def save(self):
|
|
231
|
-
"""Saves the main object in a 'mmviewer_save.vtp' vtp file is the current folder"""
|
|
232
|
-
|
|
233
|
-
writer = vtk.vtkXMLPolyDataWriter()
|
|
234
|
-
writer.SetDataModeToAscii()
|
|
235
|
-
writer.SetFileName('mmviewer_save.vtp')
|
|
236
|
-
|
|
237
|
-
for polydata in self.polydatas:
|
|
238
|
-
writer.SetInputData(polydata)
|
|
239
|
-
writer.Write()
|
|
240
|
-
|
|
241
|
-
print("File 'mmviewer_save.vtp' written in %s" % getcwd())
|
|
242
|
-
return
|
|
243
|
-
|
|
244
|
-
def screenshot(self):
|
|
245
|
-
"""Saves a screenshot of the current window in a file screenshot.png"""
|
|
246
|
-
w2if = vtk.vtkWindowToImageFilter()
|
|
247
|
-
w2if.SetInput(self.render_window)
|
|
248
|
-
w2if.Update()
|
|
249
|
-
|
|
250
|
-
writer = vtk.vtkPNGWriter()
|
|
251
|
-
writer.SetFileName("screenshot.png")
|
|
252
|
-
writer.SetInputData(w2if.GetOutput())
|
|
253
|
-
writer.Write()
|
|
254
|
-
|
|
255
|
-
print("File 'screenshot.png' written in %s" % getcwd())
|
|
256
|
-
return
|
|
257
|
-
|
|
258
|
-
# INTERACTION
|
|
259
|
-
|
|
260
|
-
def show(self):
|
|
261
|
-
"""Show the viewer"""
|
|
262
|
-
self.renderer.ResetCamera()
|
|
263
|
-
self.render_window.Render()
|
|
264
|
-
self.render_window_interactor.Start()
|
|
265
|
-
|
|
266
|
-
def on_key_press(self, obj, event):
|
|
267
|
-
"""Event trig at keystroke"""
|
|
268
|
-
key = obj.GetKeySym()
|
|
269
|
-
|
|
270
|
-
if key == 'n':
|
|
271
|
-
if self.normals:
|
|
272
|
-
# self.normals = False
|
|
273
|
-
for actor in self.normals:
|
|
274
|
-
self.renderer.RemoveActor(actor)
|
|
275
|
-
self.renderer.Render()
|
|
276
|
-
self.normals = []
|
|
277
|
-
else:
|
|
278
|
-
self.show_normals()
|
|
279
|
-
self.renderer.Render()
|
|
280
|
-
|
|
281
|
-
elif key == 'b':
|
|
282
|
-
if self.axes:
|
|
283
|
-
for axis in self.axes:
|
|
284
|
-
self.renderer.RemoveActor(axis)
|
|
285
|
-
self.axes = []
|
|
286
|
-
else:
|
|
287
|
-
self.show_axes()
|
|
288
|
-
|
|
289
|
-
elif key == 'x':
|
|
290
|
-
self.save()
|
|
291
|
-
|
|
292
|
-
elif key == 'c':
|
|
293
|
-
self.screenshot()
|
|
294
|
-
|
|
295
|
-
elif key == 'h':
|
|
296
|
-
if self.oxy_plane:
|
|
297
|
-
self.renderer.RemoveActor(self.oxy_plane)
|
|
298
|
-
self.oxy_plane = None
|
|
299
|
-
else:
|
|
300
|
-
self.add_oxy_plane()
|
|
301
|
-
|
|
302
|
-
elif key == 'e' or key == 'q':
|
|
303
|
-
self.render_window_interactor.GetRenderWindow().Finalize()
|
|
304
|
-
self.render_window_interactor.TerminateApp()
|
|
305
|
-
|
|
306
|
-
def finalize(self):
|
|
307
|
-
"""Cleanly close the viewer"""
|
|
308
|
-
del self.render_window
|
|
309
|
-
del self.render_window_interactor
|
|
310
|
-
|
|
311
|
-
# =======================================
|
|
312
|
-
# =======================================
|
|
313
|
-
# =======================================
|
|
314
|
-
|
|
315
|
-
# OTHER METHODS THAT ARE CURRENTLY UNUSED
|
|
316
|
-
|
|
317
|
-
def add_point(self, pos, color=(0, 0, 0)):
|
|
318
|
-
"""Add a point to the viewer
|
|
319
|
-
|
|
320
|
-
Parameters
|
|
321
|
-
----------
|
|
322
|
-
pos : array_like
|
|
323
|
-
The point's position
|
|
324
|
-
color : array_like, optional
|
|
325
|
-
The RGB color required for the point. Default is (0, 0, 0) corresponding to black.
|
|
326
|
-
|
|
327
|
-
Returns
|
|
328
|
-
-------
|
|
329
|
-
vtkPolyData
|
|
330
|
-
"""
|
|
331
|
-
|
|
332
|
-
assert len(pos) == 3
|
|
333
|
-
|
|
334
|
-
p = vtk.vtkPoints()
|
|
335
|
-
v = vtk.vtkCellArray()
|
|
336
|
-
|
|
337
|
-
i = p.InsertNextPoint(pos)
|
|
338
|
-
v.InsertNextCell(1)
|
|
339
|
-
v.InsertCellPoint(i)
|
|
340
|
-
|
|
341
|
-
pd = vtk.vtkPolyData()
|
|
342
|
-
pd.SetPoints(p)
|
|
343
|
-
pd.SetVerts(v)
|
|
344
|
-
|
|
345
|
-
self.add_polydata(pd, color=color)
|
|
346
|
-
|
|
347
|
-
return pd
|
|
348
|
-
|
|
349
|
-
def add_line(self, p0, p1, color=(0, 0, 0)):
|
|
350
|
-
"""Add a line to the viewer
|
|
351
|
-
|
|
352
|
-
Parameters
|
|
353
|
-
----------
|
|
354
|
-
p0 : array_like
|
|
355
|
-
position of one end point of the line
|
|
356
|
-
p1 : array_like
|
|
357
|
-
position of a second end point of the line
|
|
358
|
-
color : array_like, optional
|
|
359
|
-
RGB color of the line. Default is black (0, 0, 0)
|
|
360
|
-
|
|
361
|
-
Returns
|
|
362
|
-
-------
|
|
363
|
-
vtkPolyData
|
|
364
|
-
"""
|
|
365
|
-
|
|
366
|
-
assert len(p0) == 3 and len(p1) == 3
|
|
367
|
-
|
|
368
|
-
points = vtk.vtkPoints()
|
|
369
|
-
points.InsertNextPoint(p0)
|
|
370
|
-
points.InsertNextPoint(p1)
|
|
371
|
-
|
|
372
|
-
line = vtk.vtkLine()
|
|
373
|
-
line.GetPointIds().SetId(0, 0)
|
|
374
|
-
line.GetPointIds().SetId(1, 1)
|
|
375
|
-
|
|
376
|
-
lines = vtk.vtkCellArray()
|
|
377
|
-
lines.InsertNextCell(line)
|
|
378
|
-
|
|
379
|
-
lines_pd = vtk.vtkPolyData()
|
|
380
|
-
lines_pd.SetPoints(points)
|
|
381
|
-
lines_pd.SetLines(lines)
|
|
382
|
-
|
|
383
|
-
self.add_polydata(lines_pd, color=color)
|
|
384
|
-
|
|
385
|
-
return lines_pd
|
|
386
|
-
|
|
387
|
-
def add_vector(self, point, value, scale=1, color=(0, 0, 0)):
|
|
388
|
-
"""Add a vector to the viewer
|
|
389
|
-
|
|
390
|
-
Parameters
|
|
391
|
-
----------
|
|
392
|
-
point : array_like
|
|
393
|
-
starting point position of the vector
|
|
394
|
-
value : float
|
|
395
|
-
the magnitude of the vector
|
|
396
|
-
scale : float, optional
|
|
397
|
-
the scaling to apply to the vector for better visualization. Default is 1.
|
|
398
|
-
color : array_like
|
|
399
|
-
The color of the vector. Default is black (0, 0, 0)
|
|
400
|
-
"""
|
|
401
|
-
|
|
402
|
-
points = vtk.vtkPoints()
|
|
403
|
-
idx = points.InsertNextPoint(point)
|
|
404
|
-
|
|
405
|
-
vert = vtk.vtkCellArray()
|
|
406
|
-
vert.InsertNextCell(1)
|
|
407
|
-
vert.InsertCellPoint(idx)
|
|
408
|
-
pd_point = vtk.vtkPolyData()
|
|
409
|
-
pd_point.SetPoints(points)
|
|
410
|
-
pd_point.SetVerts(vert)
|
|
411
|
-
|
|
412
|
-
arrow = vtk.vtkArrowSource()
|
|
413
|
-
arrow.SetTipResolution(16)
|
|
414
|
-
arrow.SetTipLength(0.1)
|
|
415
|
-
arrow.SetTipRadius(0.02)
|
|
416
|
-
arrow.SetShaftRadius(0.005)
|
|
417
|
-
|
|
418
|
-
vec = vtk.vtkFloatArray()
|
|
419
|
-
vec.SetNumberOfComponents(3)
|
|
420
|
-
v0, v1, v2 = value / scale
|
|
421
|
-
vec.InsertTuple3(idx, v0, v1, v2)
|
|
422
|
-
pd_point.GetPointData().SetVectors(vec)
|
|
423
|
-
|
|
424
|
-
g_glyph = vtk.vtkGlyph3D()
|
|
425
|
-
# g_glyph.SetScaleModeToDataScalingOff()
|
|
426
|
-
g_glyph.SetVectorModeToUseVector()
|
|
427
|
-
g_glyph.SetInputData(pd_point)
|
|
428
|
-
g_glyph.SetSourceConnection(arrow.GetOutputPort())
|
|
429
|
-
g_glyph.SetScaleModeToScaleByVector()
|
|
430
|
-
# g_glyph.SetScaleFactor(10)
|
|
431
|
-
g_glyph.ScalingOn()
|
|
432
|
-
g_glyph.Update()
|
|
433
|
-
|
|
434
|
-
g_glyph_mapper = vtk.vtkPolyDataMapper()
|
|
435
|
-
g_glyph_mapper.SetInputConnection(g_glyph.GetOutputPort())
|
|
436
|
-
|
|
437
|
-
g_glyph_actor = vtk.vtkActor()
|
|
438
|
-
g_glyph_actor.SetMapper(g_glyph_mapper)
|
|
439
|
-
g_glyph_actor.GetProperty().SetColor(color)
|
|
440
|
-
|
|
441
|
-
self.renderer.AddActor(g_glyph_actor)
|
|
442
|
-
|
|
443
|
-
def add_plane(self, center, normal):
|
|
444
|
-
"""Add a plane to the viewer
|
|
445
|
-
|
|
446
|
-
Parameters
|
|
447
|
-
----------
|
|
448
|
-
center : array_like
|
|
449
|
-
The origin of the plane
|
|
450
|
-
normal : array_like
|
|
451
|
-
The normal of the plane
|
|
452
|
-
"""
|
|
453
|
-
|
|
454
|
-
plane = vtk.vtkPlaneSource()
|
|
455
|
-
plane.SetCenter(center)
|
|
456
|
-
plane.SetNormal(normal)
|
|
457
|
-
|
|
458
|
-
mapper = vtk.vtkPolyDataMapper()
|
|
459
|
-
mapper.SetInputData(plane.GetOutput())
|
|
460
|
-
|
|
461
|
-
# FIXME: terminer l'implementation et l'utiliser pour le plan de la surface libre
|
capytaine-2.3.1.dist-info/RECORD
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
capytaine/__init__.py,sha256=ffYPfnzVMU03arvItDaf5VoDa68KEGP4J9aE1MQlmQg,1822
|
|
2
|
-
capytaine/__about__.py,sha256=14fwPZt3SRhKmIUSRPB6gpUnkNBLGgZLmq6_R2Xvy_k,415
|
|
3
|
-
capytaine/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
capytaine/ui/rich.py,sha256=ZfMHUpCSVztNseIGpN2I69ts_Aw_HJ5RnZc0f73av5Q,233
|
|
5
|
-
capytaine/ui/cli.py,sha256=o3MH2OCHXFww1kb2zM9R3qs4jjfkCeeZFRAgnFnb2NE,797
|
|
6
|
-
capytaine/ui/vtk/mesh_viewer.py,sha256=y5f3Qc7vWuu_xWXxOQm1bcvwm3D_JKUbzd1M9NVqrac,14750
|
|
7
|
-
capytaine/ui/vtk/__init__.py,sha256=7wIkVipz_3JCZmLuED4-aQXZJwBYylS32PFswAdwvo4,161
|
|
8
|
-
capytaine/ui/vtk/animation.py,sha256=FYH-YAu0LY2zr7fTl36aOSkM8z74_gxQRKOJFhUSluo,12443
|
|
9
|
-
capytaine/ui/vtk/helpers.py,sha256=sOK_a679a7n9ozhcEZY3IhTWmPyctoLkFwKTyzDHrm8,2640
|
|
10
|
-
capytaine/ui/vtk/body_viewer.py,sha256=gGIla-gADWiYuiNdS2io-0whpO6AaH8A8KkEmqX4OSY,1032
|
|
11
|
-
capytaine/green_functions/__init__.py,sha256=527Pd0SIqwR64-d4sT-_jyE89XU-PLgFL0et96ChAIo,107
|
|
12
|
-
capytaine/green_functions/delhommeau.py,sha256=y9nkyVKj9ES0nL2jDLdx_5ejQ5nbMSKV0qYUnPnfTNg,23550
|
|
13
|
-
capytaine/green_functions/hams.py,sha256=yxT0ysNFxsm4VbRtywHnhtWnHrxkU8q6_DL8eEwZPTs,8252
|
|
14
|
-
capytaine/green_functions/abstract_green_function.py,sha256=6_YjjTKbYNgteWw4FWKQQI9nfpPzEETQxD3WOWFqosw,2834
|
|
15
|
-
capytaine/green_functions/FinGreen3D/test_program.f90,sha256=BlQv3O0z0tYXejz261S8l7x5H01wHAdn9-YfsRurW1w,926
|
|
16
|
-
capytaine/green_functions/FinGreen3D/LICENSE,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
|
|
17
|
-
capytaine/green_functions/FinGreen3D/Makefile,sha256=E5XU-1Ziejhp1dHfKVP_YaGzzX1u7L3m5kZoPhtSscE,354
|
|
18
|
-
capytaine/green_functions/FinGreen3D/README.md,sha256=OAL_oCou4Lf3mXE88dBhDP41yx28lxMws4Dgcu4m3jc,1980
|
|
19
|
-
capytaine/green_functions/FinGreen3D/FinGreen3D.f90,sha256=tBsSc6BfQJpaFQ6j6tEYWG25u_SixJnooiCfQ1Uu9MI,119957
|
|
20
|
-
capytaine/green_functions/FinGreen3D/.gitignore,sha256=GBMUBl3y8v2vkgsai1MR2qIWotZImgatpbScxRTYlBc,7
|
|
21
|
-
capytaine/green_functions/LiangWuNoblesse/test_program.f90,sha256=cettkRXfJDmhigo7oUACjU3qCNFLJVDU0vI6Og4UFs8,494
|
|
22
|
-
capytaine/green_functions/LiangWuNoblesse/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
|
|
23
|
-
capytaine/green_functions/LiangWuNoblesse/Makefile,sha256=txvf2ppXhnT9OPDcE8zQcEq5jQcQ3B_A0ge1vdR6huA,411
|
|
24
|
-
capytaine/green_functions/LiangWuNoblesse/README.md,sha256=0pQbZxIAWTc-9eQ2Qb62SfM5Eh3dNx0bPSznuOCx8xU,102
|
|
25
|
-
capytaine/green_functions/LiangWuNoblesse/.gitignore,sha256=GBMUBl3y8v2vkgsai1MR2qIWotZImgatpbScxRTYlBc,7
|
|
26
|
-
capytaine/green_functions/LiangWuNoblesse/LiangWuNoblesseWaveTerm.f90,sha256=BYaVrslAbglcI-7-kOz7qH3AQKLY4rvCmXaa7zfDCaM,22552
|
|
27
|
-
capytaine/green_functions/libs/Delhommeau_float64.cpython-314-darwin.so,sha256=ZncirdqnH_OCALzEId9sIGvaR6vPEaQl5PBzYWDafr4,399648
|
|
28
|
-
capytaine/green_functions/libs/Delhommeau_float32.cpython-314-darwin.so,sha256=n0r2BJKYS10Dh6c2RTO-S8Pu9L8f7ie3FQDVoylR_00,363104
|
|
29
|
-
capytaine/green_functions/libs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
|
-
capytaine/bodies/dofs.py,sha256=M5nWTeVJxmxKl2BowOnrE3plv1rrqDHNb76D_qHroS8,598
|
|
31
|
-
capytaine/bodies/bodies.py,sha256=KOBeLwpXDBQhZAjLePqXMQf8LcAl2TdOtYS_4rzIjMs,52708
|
|
32
|
-
capytaine/bodies/__init__.py,sha256=wIYFs14NAWqaHLQWvDGUEZTBWp_kdthKkbOlXHup6LA,157
|
|
33
|
-
capytaine/bodies/predefined/rectangles.py,sha256=PtNK7_RUjRIi1oJNlsBhOosC3Ib2cXX1SnW9llTmD44,4500
|
|
34
|
-
capytaine/bodies/predefined/spheres.py,sha256=8lHMqCQBQneN8EqTSXQanumt6j5TeR70CR4ckrnDfo4,2598
|
|
35
|
-
capytaine/bodies/predefined/__init__.py,sha256=IA1y5XDGmyzNDpgQvz8kjyGajBCYoClAnCPn1PxFwfw,338
|
|
36
|
-
capytaine/bodies/predefined/cylinders.py,sha256=Zfp3ecpKD72dfzv5Dd2y87EvDBBRsOJPq6GR6B76r5Y,5596
|
|
37
|
-
capytaine/tools/lru_cache.py,sha256=ssPo7sZMMe15GIxPiQ7rA0GrjwYWsE66x3A-d-4FQTI,1709
|
|
38
|
-
capytaine/tools/cache_on_disk.py,sha256=Cj2J5pNKw9PbIvxUn53swSmuGJoMibZzIvB5Skt52ig,912
|
|
39
|
-
capytaine/tools/timer.py,sha256=0kEIvYFnwa0F4ayecxLl_VtiCrVL-8i9_NrAKrlSVmo,1520
|
|
40
|
-
capytaine/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
|
-
capytaine/tools/deprecation_handling.py,sha256=_QFNrkreLerm3-LzRZ3l6B_O249PM-fCCAXMsHA7kIU,809
|
|
42
|
-
capytaine/tools/optional_imports.py,sha256=HNjtvNZGxsw-eYmr4ejq001KhLevrvqq7ASAqTOw8W8,860
|
|
43
|
-
capytaine/tools/symbolic_multiplication.py,sha256=DCmVlUwGtyUBU7VZZ0xxNnIjNSC0rQbgSuHRnlFQ8VU,4842
|
|
44
|
-
capytaine/tools/lists_of_points.py,sha256=6DyL9kr8jbkvB2IuCq288eSd4Xq6pwa8wiQCYZm9M1Q,1828
|
|
45
|
-
capytaine/tools/prony_decomposition.py,sha256=Eg8CcedPuLKVUA-wpjwXBJsnXjBGZruHVy4jMU2cCSM,5147
|
|
46
|
-
capytaine/bem/solver.py,sha256=j2ZoVGA8x46xQe61s1Dh0zCFVXnTDuehAKa3f3-bZ0o,28790
|
|
47
|
-
capytaine/bem/engines.py,sha256=YauXkOHKLbrDbzM1qisKiJ1D3LZ0-ALOWIIRNzNchUU,18070
|
|
48
|
-
capytaine/bem/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
|
-
capytaine/bem/problems_and_results.py,sha256=4pdwswnrbp7D1v1xOnBA3aYSCxm5qiaFZDJt_u5BxaA,27430
|
|
50
|
-
capytaine/bem/airy_waves.py,sha256=GAhX5xNEgjoOo2uEHXfKCxb2TnmbPBCqW6VWfvzJTM8,3498
|
|
51
|
-
capytaine/io/wamit.py,sha256=dvmthwIZnzOM8L1kq814pilCpQPLeTHvjjgg21hV2po,16028
|
|
52
|
-
capytaine/io/legacy.py,sha256=lARoaPGjTsUQ4YiLmD8ZYMSCU_UDmnOQx4_JppaCcRc,14730
|
|
53
|
-
capytaine/io/bemio.py,sha256=WXT7QPJK0t2kgUdI0DOOQG8u5zh_zk9q_PmTXqW1dJE,7334
|
|
54
|
-
capytaine/io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
|
-
capytaine/io/mesh_loaders.py,sha256=NjSWrCR20ozIFu94B7ZveiSS1kzt-IWKoFnkvLHcNXU,31771
|
|
56
|
-
capytaine/io/meshio.py,sha256=QmuHGJt_a1VDrCpA_OKVWftgHPdZyjNkao38QpGuPT8,1469
|
|
57
|
-
capytaine/io/mesh_writers.py,sha256=zLHRdzTpbpXyPsf7c09s6Nk2ZXIAQCCfHYIF3vKKDBo,21084
|
|
58
|
-
capytaine/io/xarray.py,sha256=IF-l5O9gGeBTRpcJontvvi11sYfgqwfK7wp1_MAtFHY,27057
|
|
59
|
-
capytaine/.dylibs/libgfortran.5.dylib,sha256=6uNZS_KEqHsXxVzZp8qANpYBaOKVUp4PapKX4P8wvhE,1901520
|
|
60
|
-
capytaine/.dylibs/libquadmath.0.dylib,sha256=AtjHD7yn1DtR6T2PA-Ry7z9iJFiYF9eZ4dfkBVTFa6k,363936
|
|
61
|
-
capytaine/.dylibs/libgcc_s.1.1.dylib,sha256=a2klIEBZo0Ns9hxZzfO7_Aur4CtbIedHBYCDc5gRMbg,183040
|
|
62
|
-
capytaine/meshes/clipper.py,sha256=CB38_cmha8q6hnaxKukKQPtB7sXx34fU2HBujF8hD24,18677
|
|
63
|
-
capytaine/meshes/properties.py,sha256=eJHhTtXzW-aiokuvluqLSfumAGMFZGmI3ZLP-pfVh2I,10790
|
|
64
|
-
capytaine/meshes/symmetric.py,sha256=CHBusSwTufKiGYOqVrUurQojYqlLsSWqxB-Z2kjVEYE,18239
|
|
65
|
-
capytaine/meshes/mesh_like_protocol.py,sha256=BxFLfJsHZFobyN5L0siuPRPq0DFpJbGsQw1yuFN06GQ,1042
|
|
66
|
-
capytaine/meshes/surface_integrals.py,sha256=ihxbuiSsgep4rbrBQlq2q_2p_uDXDkRPyz0S6OVofc8,2263
|
|
67
|
-
capytaine/meshes/__init__.py,sha256=5-AE32KOmOcq_F09uZanLafy7SzOe0-Cl6PaDbbOLMQ,361
|
|
68
|
-
capytaine/meshes/meshes.py,sha256=_b0DtxR_UDmV0UOuB3bZ47ClGkIKJynTWESJxiIsbio,32625
|
|
69
|
-
capytaine/meshes/collections.py,sha256=uTXQovnoPsKZfl3HqUveHc94SyscyfELILikRuAcpG0,11403
|
|
70
|
-
capytaine/meshes/geometry.py,sha256=ffeHvFzke3sXHzGexivRmSBQIOCk-pCMoveQF4eYyGM,14107
|
|
71
|
-
capytaine/meshes/quality.py,sha256=OTZvqyDSJGKIHfFWwn-QROH1Je4PjgFxbwp3Ce-nzzI,14383
|
|
72
|
-
capytaine/meshes/quadratures.py,sha256=eT5tsfonBJEDkrCnoUJbEPLX34I1rCkgzD_E6XhDu-E,3227
|
|
73
|
-
capytaine/meshes/predefined/rectangles.py,sha256=lbT8lYsij1bEo1CB9_NVrTsFBpOfedK7fPu-jB8OsV8,12294
|
|
74
|
-
capytaine/meshes/predefined/spheres.py,sha256=dJMcGBgGwJ93V9JBzACy7byKRZe_hj42bCb3wOuSlBI,2212
|
|
75
|
-
capytaine/meshes/predefined/__init__.py,sha256=uc2b-3UJi_4NnTkk6wRlbq5UTKOyRU7JTpMDdlUrjiY,365
|
|
76
|
-
capytaine/meshes/predefined/cylinders.py,sha256=s3VwoQknY9Fnun6zukVccHh6h3rG-5NvLsiTlONbJVs,14846
|
|
77
|
-
capytaine/post_pro/rao.py,sha256=kLePr2sbh38f-ydjQTIyeRuoDDqEootqwLSt575aGik,2293
|
|
78
|
-
capytaine/post_pro/free_surfaces.py,sha256=NIrPoaZGC6-F4mSG8ZwelJsjKaSMGBjtRlwSRG3wuvQ,3117
|
|
79
|
-
capytaine/post_pro/__init__.py,sha256=fi9BE68OzphGjf08HYGcCPmZLJYnD-wHjz86QEXkBn8,274
|
|
80
|
-
capytaine/post_pro/kochin.py,sha256=vEjH850aOnSUprD8cnOSkvTGFdn2X9KAIDvehsxud3s,1927
|
|
81
|
-
capytaine/post_pro/impedance.py,sha256=gNMKkSyD4qN55_PrTZhrtsh2XsAbC3ciFCWtvpJLKLM,3492
|
|
82
|
-
capytaine/matrices/builders.py,sha256=a4P0gamYOUdf4r6ZGK_PuAyec3UZGQQaUljotWp6d8E,3153
|
|
83
|
-
capytaine/matrices/low_rank.py,sha256=Z9nOVsTCrIXQ9-A-upz8UTdcc2uNuZ9VlAO8Tee1Si0,15996
|
|
84
|
-
capytaine/matrices/linear_solvers.py,sha256=_5R-CR7eJ07Z3GcOd1YiX2bRyukuXQnHE0Dgpo8G2R8,8937
|
|
85
|
-
capytaine/matrices/block_toeplitz.py,sha256=yL4GFPghfdVZTKtden0RKVDhpiBZz3D1oZ-pAVjDBjg,12930
|
|
86
|
-
capytaine/matrices/__init__.py,sha256=_b868RYRI8ANHHf2PUVI-2_c0RdBfRDHLvJW5Uq1qys,704
|
|
87
|
-
capytaine/matrices/block.py,sha256=9Gv800-regvNmD62-h9MvbW7vtPb4N-_3o8Y8HPnxgc,25486
|
|
88
|
-
capytaine-2.3.1.dist-info/RECORD,,
|
|
89
|
-
capytaine-2.3.1.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
|
|
90
|
-
capytaine-2.3.1.dist-info/WHEEL,sha256=Q3EhUKygK5Q9W9F4MYfQpEC77_UpphYa9oSwWTgSRRI,122
|
|
91
|
-
capytaine-2.3.1.dist-info/entry_points.txt,sha256=R72-je8lc6ELm8ftt7lJ7f1aalnQs5BWYrGDBMexHII,53
|
|
92
|
-
capytaine-2.3.1.dist-info/METADATA,sha256=ftEZnZzzOAlQ85oSpm66yuOls3Sh6ypK-bEYP3EcKME,45072
|
|
File without changes
|
|
File without changes
|
|
File without changes
|