This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// coords are a list of Vector3D | |
// polygons are a sequence of triangles | |
// triangles are a list of 3 vertices | |
// vertices are a Vector3D | |
let triangle a b c = [a;b;c] | |
let coordsToPolygon coords = | |
let fst = Seq.head coords | |
let triangleF = function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "colors.inc" | |
#include "textures.inc" | |
global_settings { | |
assumed_gamma 1.0 | |
radiosity { | |
brightness 2.2 | |
count 300 | |
error_bound 0.15 | |
gray_threshold 0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let frame_old (size:Vector3D) = | |
let beamThickness = VerandaOpts.unit.beamUnit.z | |
let horizontalGeometry = CubeGeometry <| Vector3D.fromDecimal (size.x-beamThickness*2M) beamThickness size.z | |
let horizontalObject = Object3D.mesh horizontalGeometry ShinyStuff | |
let width = size.y - beamThickness |> DY | |
let topBeam = horizontalObject + width.half | |
let bottomBeam = horizontalObject - width.half |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let frame width height = | |
let context = Builder.zero | |
let horizontalBeam = a_beam.with_a_width_of ( width ) | |
let verticalBeam = a_beam.with_a_height_of ( height - horizontalBeam.height * 2M ) | |
let topBeam = context.add a horizontalBeam anchoring its TopLeftFront on the TopLeftFront context.boundingBox | |
let leftBeam = context.add a verticalBeam anchoring its TopLeftFront on the BottomLeftFront topBeam.boundingBox | |
let rightBeam = context.add a verticalBeam anchoring its TopRightFront on the BottomRightFront topBeam.boundingBox | |
let bottomBeam = context.add a horizontalBeam anchoring its BottomLeftFront on the BottomLeftFront leftBeam.boundingBox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$el.find("input[type=checkbox]").change(function () { | |
var checked = $(this).is(":checked"); | |
var $parent = $($(this).parent()); | |
$parent.find("input[type=checkbox]").each(function () { | |
if (checked) { | |
$(this).attr("checked", "checked"); | |
} | |
else { | |
$(this).removeAttr("checked"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var specification = | |
TSql.Projection(). | |
When<PortfolioAdded>(@event => | |
TSql.NonQuery( | |
"INSERT INTO [Portfolio] (Id, Name) VALUES ({0}, {1})", | |
TSql.Int(@event.Id), TSql.NVarChar(@event.Name, 40) | |
). | |
When<PortfolioRemoved>(@event => | |
TSql.NonQuery( | |
"DELETE FROM [Portfolio] WHERE Id = {0}", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let getSupportingWalls veranda = | |
let boundingBox = {size=Vector3D.zero;center = {x=0M;y=0M;z= -veranda.buildingBlocks.wall.size.depth/2M}} | |
let walls = veranda.walls | |
let bricks = veranda.buildingBlocks.wall | |
let context = Builder.zero | |
let backWallBlock = bricks.with_a_width_and_height_of walls.middle walls.height |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type BuildingBlocks = { | |
beam: BuildingBlock | |
wall: BuildingBlock | |
roof: BuildingBlock | |
floor: BuildingBlock | |
ground: BuildingBlock | |
outsideFloor: BuildingBlock | |
flatBeam: BuildingBlock | |
pilar: BuildingBlock | |
blackPilar: BuildingBlock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System.Runtime.Serialization | |
[<DataContract>] | |
type Vector3D = { | |
[<DataMember>] x: decimal | |
[<DataMember>] y: decimal | |
[<DataMember>] z: decimal | |
} with | |
member this.width = this.x | |
member this.height = this.y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace FPExplainedV2 | |
{ | |
// another implementation to test category theory; this time I implement a list... | |
public class FList<TObject> |