Parses optical density, also known as index of refraction Ni
(fields []string)
| 869 | // Parses optical density, also known as index of refraction |
| 870 | // Ni <optical_density> |
| 871 | func (dec *Decoder) parseNi(fields []string) error { |
| 872 | |
| 873 | if len(fields) < 1 { |
| 874 | return dec.formatError("'Ni' with no fields") |
| 875 | } |
| 876 | val, err := strconv.ParseFloat(fields[0], 32) |
| 877 | if err != nil { |
| 878 | return dec.formatError("'d' parse float error") |
| 879 | } |
| 880 | dec.matCurrent.Refraction = float32(val) |
| 881 | return nil |
| 882 | } |
| 883 | |
| 884 | // Parses specular exponent |
| 885 | // Ns <specular_exponent> |
no test coverage detected