Skip to main content
Question

Error: @Coordinate is out of range -- it must be an integer i such that -n <= i < n, where n is the number of vertices in the feature


Forum|alt.badge.img

So  i get this error:

FME Configuration: Source coordinate system for reader IFC_2[IFC] set to `IFC_COORDSYS_0' as read from input data

Coordinate System `IFC_COORDSYS_0' parameters: CS_NAME=`IFC_COORDSYS_0' DT_NAME=`WGS84' ORG_LAT=`42.41486358638889' ORG_LNG=`-71.25807189916667' PROJ=`AZMED' QUAD=`1' UNIT=`MILLIMETER' X_OFF=`0.0' Y_OFF=`0.0' 

Storing feature(s) to FME feature store file `C:\FOO\Bar\wb-xlate-1539634722829_3772_221844\inspector.ffs'

NormalVectorFinder_Walls_CoordinateExtractor_9(TestFactory): NormalVectorFinder_Walls_CoordinateExtractor_9: <index> parameter (84to @Coordinate is out of range -- it must be an integer i such that -n <= i < n, where n is the number of vertices in the feature -- in this case 80

NormalVectorFinder_Walls_CoordinateExtractor_9: <index> parameter (84to @Coordinate is out of range -- it must be an integer i such that -n <= i < n, where n is the number of vertices in the feature -- in this case 80

A fatal error has occurred. Check the logfile above for details

I am trying to use a vertices counter for getting the second to last coordinate from a IFMEBREPSOLID. The coordinate is picked with the arithmetic evaluator in a coordinate extractor.

0684Q00000ArBmaQAF.png

I have tried the explaniation in this question and also my own formulas:@sub(@NumCoords(FLATTEN_AGGREGATE),2) and @sub(@Value(_coordcount_normal_vector),2) .

I haven't been able to find anything else in the about the error so now I am posting this question. How can I count the number of coordinates (vertices) in a IFMEBREPSOLID corectly? And prefrebly get the second to last coordinate?

Edit: To clarify I want to use the attribute created by the VertexCounter to get the coordinate of the second to last coordinate in my geometry.

4 replies

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • October 16, 2018

Hi @hadhafang, possibly the VertexCounter (equivalent to the @NumCoords function) could return a number greater than the number of actual vertices from a solid geometry. I don't know why, but you can use the CoordinateConcatenator to find what excessive coordinates are extracted.

A possible workaround is to use the CoordinateExtractor (Mode: All Coordinates) to extract all the coordinates as a list attribute and then get your desired one from the list.


fmelizard
Contributor
Forum|alt.badge.img+17
  • Contributor
  • October 16, 2018
takashi wrote:

Hi @hadhafang, possibly the VertexCounter (equivalent to the @NumCoords function) could return a number greater than the number of actual vertices from a solid geometry. I don't know why, but you can use the CoordinateConcatenator to find what excessive coordinates are extracted.

A possible workaround is to use the CoordinateExtractor (Mode: All Coordinates) to extract all the coordinates as a list attribute and then get your desired one from the list.

@takashi is right that the VertexCounter / CoordinateExtractor combo may not be safe to use with BRepSolids. I think a safer plan is the CoordinateExtractor, or a GeometryExtractor to get the data out into an attribute in a format you could then parse yourself.

 

But I should ask -- what problem you are looking to solve? Perhaps we could add a proper primitive so you'd not have to do this?

 


Forum|alt.badge.img
  • Author
  • October 16, 2018
fmelizard wrote:
@takashi is right that the VertexCounter / CoordinateExtractor combo may not be safe to use with BRepSolids. I think a safer plan is the CoordinateExtractor, or a GeometryExtractor to get the data out into an attribute in a format you could then parse yourself.

 

But I should ask -- what problem you are looking to solve? Perhaps we could add a proper primitive so you'd not have to do this?

 

I am trying to convert an IFC file to a COLLADA file. Most of my problems seems to have to do with the IFCWallStandardCase entity.

 

 

For this particular I am using a a series of three coordinate extractor to create normal vectors to the wall. The normal vector are then to be used for filtering in accordans with the Level of Detail i want for the final object.

 

 

I tried using the transformer described in Convert complex IFC solid geometry to MultiSurface but since it crashes for a less clear reason i just moved on.

Forum|alt.badge.img
  • Author
  • October 16, 2018
takashi wrote:

Hi @hadhafang, possibly the VertexCounter (equivalent to the @NumCoords function) could return a number greater than the number of actual vertices from a solid geometry. I don't know why, but you can use the CoordinateConcatenator to find what excessive coordinates are extracted.

A possible workaround is to use the CoordinateExtractor (Mode: All Coordinates) to extract all the coordinates as a list attribute and then get your desired one from the list.

So I made this series of transformers. Seem the series of transformer I used as a template was from FME 2017 and didn't have the coordinate list option.

 

 

The attribute creator hover will now only return a null value i am unsure why.

 

@Value(_indices_normal{@sub(@Value(_nbr_indices),2}.x)

 

The value is coorect.

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings