objects

package
v0.0.0-...-8085f4c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToVec

func ToVec(data *[]interface{}, vec *mgl64.Vec3) error

Types

type Cube

type Cube struct {
	Object
	// parameters are center and side length
	Center mgl64.Vec3
	Side   float64
	Rho    float64
}

func (*Cube) Density

func (c *Cube) Density(x, y, z float64) float64

func (*Cube) FromMap

func (c *Cube) FromMap(data map[string]interface{}) error

func (*Cube) MinFeatureSize

func (c *Cube) MinFeatureSize() float64

func (*Cube) ToMap

func (c *Cube) ToMap() map[string]interface{}

type Cylinder

type Cylinder struct {
	Object
	// cylinder is a line segment with thickness
	P0, P1 mgl64.Vec3
	Radius float64
	Rho    float64
}

func (*Cylinder) Density

func (cyl *Cylinder) Density(x, y, z float64) float64

func (*Cylinder) FromMap

func (c *Cylinder) FromMap(data map[string]interface{}) error

func (*Cylinder) MinFeatureSize

func (cyl *Cylinder) MinFeatureSize() float64

func (*Cylinder) ToMap

func (c *Cylinder) ToMap() map[string]interface{}

type Object

type Object interface {
	Density(x, y, z float64) float64
	ToMap() map[string]interface{}
	FromMap(data map[string]interface{}) error
	MinFeatureSize() float64
}

type ObjectCollection

type ObjectCollection struct {
	Objects []Object
}

func (*ObjectCollection) Density

func (oc *ObjectCollection) Density(x, y, z float64) float64

func (*ObjectCollection) FromMap

func (oc *ObjectCollection) FromMap(data map[string]interface{}) error

func (*ObjectCollection) MinFeatureSize

func (oc *ObjectCollection) MinFeatureSize() float64

func (*ObjectCollection) ToMap

func (oc *ObjectCollection) ToMap() map[string]interface{}

type Sphere

type Sphere struct {
	Object
	// parameters are center and radius
	Center mgl64.Vec3
	Radius float64
	Rho    float64
}

func (*Sphere) Density

func (s *Sphere) Density(x, y, z float64) float64

func (*Sphere) FromMap

func (s *Sphere) FromMap(data map[string]interface{}) error

func (*Sphere) MinFeatureSize

func (s *Sphere) MinFeatureSize() float64

func (*Sphere) ToMap

func (s *Sphere) ToMap() map[string]interface{}

type TessellatedObjColl

type TessellatedObjColl struct {
	// lattice is given by unit cell and bounds for tessellation
	UC                                 UnitCell
	Xmin, Xmax, Ymin, Ymax, Zmin, Zmax float64
}

func (*TessellatedObjColl) Density

func (l *TessellatedObjColl) Density(x, y, z float64) float64

func (*TessellatedObjColl) FromMap

func (l *TessellatedObjColl) FromMap(data map[string]interface{}) error

func (*TessellatedObjColl) ToMap

func (l *TessellatedObjColl) ToMap() map[string]interface{}

type UnitCell

type UnitCell struct {
	// object collection. But overload density method and provide bounds
	Struts                             ObjectCollection
	Xmin, Xmax, Ymin, Ymax, Zmin, Zmax float64
}

func MakeKelvin

func MakeKelvin(rad float64, scale float64) UnitCell

func (*UnitCell) Density

func (uc *UnitCell) Density(x, y, z float64) float64

func (*UnitCell) FromMap

func (uc *UnitCell) FromMap(data map[string]interface{}) error

func (*UnitCell) ToMap

func (uc *UnitCell) ToMap() map[string]interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL