Opened 9 years ago

Closed 5 years ago

## #44 closed defect (fixed)

# ModelGeometry: for cuboids, sampling points should be located on edges

Reported by: | Maciej Komosinski | Owned by: | |
---|---|---|---|

Priority: | major | Milestone: | |

Component: | Framsticks core | Version: | |

Keywords: | Cc: |

### Description

Improperly placed sampling points (missing one "row" along edges? needs verification) may be the reason for inaccurate estimation of cuboid sizes. Test with:

frams "var m=Model.newFromString(\"//0\np:sh=2\n\"); var mg=ModelGeometry.forModel(m); mg.geom_density=2; Simulator.print(mg.sizesAndAxes());" -q

Instead of nice round numbers, we get

[(3.46410161513775,3.2659863237109,2.82842712474619),Orient@(-1.5708,0.61548,0.785398)]

### Change History (2)

### comment:1 Changed 9 years ago by

Summary: | ModelGeometry: for cuboids, sampling point should be located on edges → ModelGeometry: for cuboids, sampling points should be located on edges |
---|

### comment:2 Changed 5 years ago by

Resolution: | → fixed |
---|---|

Status: | new → closed |

**Note:**See TracTickets for help on using tickets.

The result is correct, sizexyz should not be

`2.0`

in this case as one might expect. For example, the first value ("length") is thelongest diagonalin the cube with edge length of 2, so`sqrt(12)=3.464101615137754587`

. The other values ("width" and "depth") are also analogously correct.