C++ or C# example of Detector Object

  • 8 April 2021
  • 3 replies
  • 98 views

Badge
  • Infrared
  • 7 replies

Hi


I have an OpticStudio project where I am able to import a .STL file and I would like to create detector rectangles from its surfaces.


Is there a way of doing that in C++ / C# using the ZOS-API?  I would greatly appreciate it if I could have a starting point.


Ideally I would like to create detectors from all of the surfaces, but from what I have seen a detector has to be a rectangle.  Is that correct?  I would like to be able to export the detector data, probably in the form of individual exports for each surface.


Thanks in advance


Jo Ling


 


Edited to add:  Sorry, I forgot to put a sensible title for this thread, and I don't know how to update it!


3 replies

Userlevel 6
Badge +2

Hi Jo

I have updated your title, I don't think you can. Let me know if that is ok for you.

Any objects (almost nearly all) can be changed into a detector:

210409-082723-det.png

Then in the Detector Viewer, you can access the results under the text tab.

This can also be read directly from the API. I have attached an example in Matlab.

Would that help?

Another way can be to read data directly from a ZRD file. An example is given here: https://support.zemax.com/hc/en-us/articles/1500005577762-How-to-create-a-Time-Of-Flight-User-Analysis-using-ZOS-API

Do not hesitate if you have any further questions.

Sandrine

Badge

Hi


Thank you for that.  I was able to see the text for the detector object I had created from a single CAD object.


I can see also that it contained only 260 pixels.  As this CAD object is the size of a whole room, I would like more pixels than that.  Is there a way to increase the number of pixels when making an object into a detector?  I know it's possible with a detector rectangle, but I don't know how to do it from an object that has been labelled as a detector.


Thank you.


Best Regards


Jo

Userlevel 6
Badge +2

Hi Jo


The number of pixels is linked to the objects. For example, if the object is an OpticStudio native object, you can change the Drawing resolution to get more pixels. 



The pixels can be seen on the Shaded Model by selecting Wireframe:



For a CAD object, you have similar properties under the CAD section:



Check the help files for the definition.


Let us know if that helps and of course do not hesitate if you have any further questions.


Sandrine

Reply