Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertNodeToMesh(node *Node, mesh *gengeometry.Mesh)
- func GenerateSampleCathedral()
- type BaseStyle
- type CeilingStyle
- type CurtainsStyle
- type Decoration
- type DoorStyle
- type FloorStyle
- type GlassStyle
- type Node
- type NodeRule
- type RoofStyle
- type Rule
- type RuleCollection
- type ShapeData
- type Style
- type WallStyle
- type WindowStyle
Constants ¶
View Source
const ( ShapeTypeRect = iota ShapeTypePlus ShapeTypeCircle ShapeTypeTriangle ShapeTypeH )
View Source
const ( ComplexityNone = 0 ComplexitySimple = 1 ComplexityIntricate = 2 ComplexityDetailed = 3 ComplexityMasterful = 4 )
View Source
const ( DecorationTypeNone = "undecorated" DecorationTypePainted = "painted" DecorationTypeCarved = "carved" DecorationTypeInlaid = "inlaid" DecorationTypeGilded = "gilded" )
View Source
const ( SizeNone = 0 SizeTiny = 1 SizeSmall = 2 SizeMedium = 3 SizeLarge = 4 SizeHuge = 5 )
View Source
const ( MaterialStone = "stone" MaterialWood = "wood" MaterialBrick = "brick" MaterialGlass = "glass" MaterialMetal = "metal" MaterialMarble = "marble" MaterialPlaster = "plaster" MaterialPaper = "paper" MaterialClay = "clay" MaterialCeramic = "ceramic" MaterialPlastic = "plastic" MaterialLeather = "leather" MaterialFur = "fur" MaterialBone = "bone" MaterialShell = "shell" )
View Source
const ( FinishNone = "none" FinishPolished = "polished" FinishRough = "rough" FinishBurnished = "burnished" FinishPainted = "painted" FinishPlastered = "plastered" )
View Source
const ( RoofShapeNone = "none" RoofShapeGable = "gable" RoofShapeHip = "hip" RoofShapeDutch = "dutch" RoofShapeJerkin = "jerkin" RoofShapePyramid = "pyramid" RoofShapeMansard = "mansard" RoofShapeBonnet = "bonnet" RoofShapeGambrel = "gambrel" RoofShapeSilikon = "silikon" RoofShapeCurved = "curved" RoofShapeFlat = "flat" RoofShapeSaltbox = "saltbox" RoofShapeButterfly = "butterfly" RoofShapeSawtooth = "sawtooth" RoofShapeDormer = "dormer" )
View Source
const ( RoofMaterialNone = "none" RoofMaterialWoodPlanks = "wood_planks" RoofMaterialWoodShingles = "wood_shingles" RoofMaterialHide = "hide" RoofMaterialThatch = "thatch" RoofMaterialStraw = "straw" RoofMaterialSlate = "slate" RoofMaterialTile = "tile" RoofMaterialMetal = "metal" RoofMaterialGlass = "glass" )
View Source
const ( ShapeRectangle = "rectangle" ShapeCircle = "circle" ShapeTrapazoid = "trapazoid" ShapeOval = "oval" ShapeTriangle = "triangle" ShapeHexagon = "hexagon" ShapeOctagon = "octagon" ShapeArch = "arch" )
View Source
const ( GlassTypeNone = "none" GlassTypeClear = "clear" GlassTypeFrosted = "frosted" GlassTypeEtched = "etched" GlassTypeTinted = "tinted" GlassTypePatterned = "patterned" GlassTypeObscured = "obscured" GlassTypeStained = "stained" GlassTypeBottle = "bottle" )
View Source
const ( FabricTypeNone = "none" FabricTypeSilk = "silk" FabricTypeCotton = "cotton" FabricTypeLinen = "linen" FabricTypeWool = "wool" FabricTypeVelvet = "velvet" FabricTypeLeather = "leather" FabricTypeFur = "fur" FabricTypeSuede = "suede" FabricTypeDenim = "denim" FabricTypeCanvas = "canvas" FabricTypeBurlap = "burlap" FabricTypeCorduroy = "corduroy" FabricTypeChiffon = "chiffon" FabricTypeSatin = "satin" FabricTypeTaffeta = "taffeta" FabricTypeTweed = "tweed" FabricTypeLace = "lace" FabricTypeOrganza = "organza" FabricTypeJersey = "jersey" FabricTypePique = "pique" FabricTypePoplin = "poplin" )
Variables ¶
View Source
var Materials = []string{ MaterialStone, MaterialWood, MaterialBrick, MaterialGlass, MaterialMetal, MaterialMarble, MaterialPlaster, MaterialPaper, MaterialClay, MaterialCeramic, MaterialPlastic, MaterialLeather, MaterialFur, MaterialBone, MaterialShell, }
View Source
var SampleRules = []*Rule{ { Name: "base", Shape: ShapeTypePlus, Width: 2, Length: 2, Height: 0.2, Roof: true, RulesSides: []string{"wing"}, RulesCorners: []string{"corner"}, }, { Name: "wing", Shape: ShapeTypeRect, Width: 0.35, Length: 0.35, Height: 0.2, Roof: true, RulesSides: []string{"strut"}, RulesCorners: []string{"strut"}, }, { Name: "corner", Shape: ShapeTypeRect, Width: 0.1, Length: 0.1, Height: 0.2, Roof: true, RulesSides: []string{"strut"}, RulesCorners: []string{"strut"}, }, { Name: "strut", Shape: ShapeTypeRect, Width: 0.025, Length: 0.025, Height: 0.2, RulesSides: []string{}, RulesCorners: []string{}, }, }
View Source
var SampleRules2 = []*Rule{ { Name: "base", Shape: ShapeTypeRect, Width: 2, Length: 2, Taper: 1, Height: 1, RulesSides: []string{"side"}, }, { Name: "side", Shape: ShapeTypeH, Width: 1.51, Length: 0.51, Height: 0.35, Roof: true, Reorient: true, RulesSides: []string{"strut"}, RulesCorners: []string{"strut"}, }, { Name: "strut", Shape: ShapeTypeRect, Width: 0.025, Length: 0.025, Height: 0.35, Reorient: true, RulesSides: []string{}, RulesCorners: []string{}, }, }
Functions ¶
func ConvertNodeToMesh ¶
func ConvertNodeToMesh(node *Node, mesh *gengeometry.Mesh)
func GenerateSampleCathedral ¶
func GenerateSampleCathedral()
Types ¶
type BaseStyle ¶
type BaseStyle struct { Ornate *Decoration // decoration of the component Material string // main material of the component Finish string // finish of the component }
BaseStyle is a struct that contains the basic style information for a building component. It can be embedded in other structs to provide a common set of style information.
func (BaseStyle) Description ¶
Description returns a string describing the style of the component.
type CeilingStyle ¶
type CeilingStyle struct {
BaseStyle
}
type Decoration ¶
func (Decoration) Description ¶
func (d Decoration) Description() string
type DoorStyle ¶
func (DoorStyle) Description ¶
type FloorStyle ¶
type FloorStyle struct {
BaseStyle
}
type GlassStyle ¶
type Node ¶
type NodeRule ¶
type RoofStyle ¶
func (RoofStyle) Description ¶
type Rule ¶
type Rule struct { Name string // Name of the rule. Shape int // The shape of the base. Roof bool // Whether the roof should be generated. Reorient bool // Whether the shape should be reoriented. Width float64 // Width of the base. Length float64 // Length of the base. Height float64 // Height of the shape. Elevation float64 // How much the roof is elevated from the base. Taper float64 // How much the mesh is tapered. RulesSides []string // Rules to apply to the sides. RulesCorners []string // Rules to apply to the corners. }
func (*Rule) GetShape ¶
func (r *Rule) GetShape() gengeometry.Shape
type RuleCollection ¶
func NewRuleCollection ¶
func NewRuleCollection() *RuleCollection
func (*RuleCollection) AddRule ¶
func (rc *RuleCollection) AddRule(r *Rule)
func (*RuleCollection) Run ¶
func (rc *RuleCollection) Run() *gengeometry.Mesh
type Style ¶
type Style struct { OuterDoorStyle DoorStyle InnerDoorStyle DoorStyle WindowStyle WindowStyle InnerWallStyle WallStyle OuterWallStyle WallStyle FloorStyle FloorStyle CeilingStyle CeilingStyle RoofStyle RoofStyle }
func GenerateStyle ¶
func (Style) Description ¶
type WallStyle ¶
func (WallStyle) Description ¶
type WindowStyle ¶
type WindowStyle struct { Shape string Size int BaseStyle Glass GlassStyle Curtains CurtainsStyle }
func (WindowStyle) LightValue ¶
func (s WindowStyle) LightValue() int
Source Files ¶
Click to show internal directories.
Click to hide internal directories.