mirror of
http://124.126.16.154:8888/singularity/HyperfDevelopmentKit.git
synced 2026-01-15 00:35:08 +08:00
feat(studio.resource): 增加了材料-晶格的力学关系
密度比 => k * 硬度 ^ a Signed-off-by: 李东云 <dongyun.li@luxcreo.ai>
This commit is contained in:
@@ -74,6 +74,7 @@ class Lattice extends JsonResource
|
||||
'c0' => (float)$this->c0,
|
||||
'scalingRatio' => (float)$this->pivot->scaling_ratio,
|
||||
'evaluation' => LatticeEvaluation::make($this->evaluation),
|
||||
'material' => Material::collection($this->material),
|
||||
];
|
||||
}
|
||||
}
|
||||
32
src/Studio/Resource/Material.php
Normal file
32
src/Studio/Resource/Material.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Material.php@LuxStudio
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/7/21
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Studio\Resource;
|
||||
|
||||
use Hyperf\Resource\Json\JsonResource;
|
||||
use Singularity\HDK\Utils\Resource\ClassicResponse;
|
||||
|
||||
class Material extends JsonResource
|
||||
{
|
||||
use ClassicResponse;
|
||||
|
||||
public function toArray(): array
|
||||
{
|
||||
return [
|
||||
'name' => $this->name,
|
||||
// 密度比
|
||||
'densityRatio' => [
|
||||
'k' => $this->pivot->k,
|
||||
'a' => $this->pivot->a,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user