Skip to content

Commit 6d238aa

Browse files
committed
fix: adding analytical fold builder
1 parent efb46a2 commit 6d238aa

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

LoopStructural/modelling/features/builders/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
from ._folded_feature_builder import FoldedFeatureBuilder
44
from ._structural_frame_builder import StructuralFrameBuilder
55
from ._fault_builder import FaultBuilder
6+
from ._analytical_fold_builder import AnalyticalFoldBuilder
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from ._base_builder import BaseBuilder
2+
from .._lambda_geological_feature import LambdaGeologicalFeature
3+
import numpy as np
4+
class AnalyticalFoldBuilder(BaseBuilder):
5+
def __init__(self, model, name: str = 'Feature'):
6+
super().__init__(model=model,name=name)
7+
self._wavelength = np.max(model.bounding_box.length)
8+
self._amplitude = np.min(model.bounding_box.length)
9+
self._centre = model.bounding_box
10+
@property
11+
def amplitude(self):
12+
return self._amplitude
13+
@property
14+
def wavelength(self):
15+
return self._wavelength
16+
17+
@property
18+
def feature(self):
19+
def function(xyz):
20+
return xyz[:,2]+np.sin(xyz[:,0]/self.wavelength)*self.amplitude
21+
return LambdaGeologicalFeature(function=function,model=self.model,name=self.name)

0 commit comments

Comments
 (0)