Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
update: set real model to dfn
Browse files Browse the repository at this point in the history
  • Loading branch information
uysalibov committed Mar 14, 2024
1 parent 927e0fe commit f90d1ef
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
19 changes: 11 additions & 8 deletions marble-sculp/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ async def marble(request: Request, payload: DiscModel):


@app.post("/dfn")
async def dfn(request: Request, payload: DiscModel):
async def dfn(request: Request, payload: FractureModel):
scene = Scene()
marb = Marble(
size=[payload.sizeX, payload.sizeY, payload.sizeZ],
Expand All @@ -207,18 +207,20 @@ async def dfn(request: Request, payload: DiscModel):
circ.move(i["positionX"], i["positionY"], i["positionZ"])
disc = circ.intersections(marb.edges, marb.vertices)
if disc:
count = randint(1, 7)
count = randint(1, 4)
for _ in range(count):
bae = disc.baecher(i["dip"], i["dipDirection"], 3, "log", 5, 4)
bae = disc.baecher(i["dip"], i["dipDirection"], 3, "det", 50, 0)
bae_rot = calculate_dip_and_dip_direction_from_unit_vec(
bae["unit_vector"]
)
circ2 = Circle()
print(bae["value"])
circ2 = Circle(radius=bae["value"])
circ2.rotate(bae_rot[0], bae_rot[1])
circ2.move(bae["pos"][0], bae["pos"][1], bae["pos"][2])
inter = circ2.intersections(marb.edges, marb.vertices)
if inter:
scene.add(inter)
scene.add(circ2)
# inter = circ2.intersections(marb.edges, marb.vertices)
# if inter:
# scene.add(inter)

scene.convert_objV2(filename="dfn/" + payload.filename)

Expand Down Expand Up @@ -276,7 +278,8 @@ async def extend(request: Request, payload: DiscModel):
a += 1
# if i == 0 and j == 0:
# continue
for d in range(len(payload.data)):
# for d in range(len(payload.data)):
for d in range(3):
discon = deepcopy(payload.data[d])

temp_circ = Circle(radius=10)
Expand Down
7 changes: 4 additions & 3 deletions marble-sculp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ class FractureModel(BaseModel):
sizeX: float
sizeY: float
sizeZ: float
fisherConstant: int
maxFractureCount: int
fisherConstant: float
distributionSize: FractureTypes
meanFractureSize: int
sigmaFractureSize: int
meanFractureSize: float
sigmaFractureSize: float
data: List[Discontinous]


Expand Down

0 comments on commit f90d1ef

Please sign in to comment.