Calculating 3d cone of camera vision

I have an idea for a 3d print I want to make to ‘adapt’ my wyze cams to various windows.

Basically there will be three “parts” that are digitally merged into one part to be 3d printed based on the angle I desire to put the camera at:

  1. a flat plate that i double-side-tape to the glass.
  2. a tight fitting box that holds the camera
  3. a connecting tunnel ‘link’ between them.

1&2 are easy.
And I could cheat for 3 and just make it way bigger than I need. But I don’t want to cheat.

I want the connection between the plate and the cam box to be as compact as possible. At first I thought this would mean a literal cone, but the camera sensor is rectangular, not round, so it would be a 4 sided pyramid.

How do I go about calculating this?

I assume there’s some angle up and down, and some angle left and right, beyond which the cam can not see.

I would assume the up angle = the down angle, and the left angle = the right angle.

But I already had an interesting prior experience with a cam mounted directly face on into a window. There is a sticker on the outside of the window, and I cut a hole in the sticker with an exacto knife to clear the view for the cam.

What I found then was that while the top and bottom were flat edges, the sides ended up being curved inward. I watched on cam and cut at the same time with the exacto until the whole screen was clear. What came out at the end was not a flat rectangle.

WHY?

Is there a name for the phenomenon? I imagine hollywood uses camera sun visors or something to reduce glare and those have to be calculated the same way.

What I’d ideally create is an OpenSCAD script that you input the horizontal and vertical angles you want for your cam and it pumps out an STL file of the mount. These mounts would make the cameras look cleaner outside the house, and would let you easily remove the camera to program and change SD cards without loosing the angle you carefully adjusted motion zones for. So I really want to design it right!

I might also consider building in ‘light traps’. beveled edges inside the cone to capture unwanted light, for a clearer picture. But I’m not entirely sure the fidelity of 3d printers is good enough for that.

This sounds like a @victormaletic type of project… :slight_smile:

5 Likes

Sure does. I wonder whether traditional flexible lens bellows might be a better solution than trying to create different sets of fixed plastic “tunnel” extensions.

1 Like

Hello @BillyCroan and @Customer

BillyCroan, before contemplating the first three requirements in your post #1
I experimented with simple square tube shields made of cardboard and with wood or 3D printed attachment collars as shown below with various side and vertical angles.


I noticed that portions of the Sq Tube Shield interfered with the camera’s FOV (field of view). To save time, material, and effort, I used a spreadsheet to calculate the layout ordinates for the various aim angles. I made two versions: a single 45°x 0° at 5° intervals and a compound 45°x45° at 5° intervals for comparisons with a live camera view. The picture groups below will provide a quantitive look at how FOV is affected by single and compound angles.

Concerning your three requirements for a compact, custom-aimed window-mounted camera holder that includes a light shield flange that serves as a tape mounting surface. The picture below is a Sq Tube Shield with a compound aim angle of 20° left and 25° down.


Notice that the camera’s base has been removed to make a lighter and compact holder. Also, the base notch resulting from the removal of the base is replaced with a Filler Plate. To minimize power cord weight on the camera holder a Cord Anchor is used. The camera Holder, Filler Plate, and Cord Anchor were printed at my local library.

I drew this camera holder in Autocad using its 3D functions with dimension values taken directly from a camera with digital calipers to the nearest 0.01mm. The dimensions were adjusted to allow for 3D printer error and to promote easy slip fits between the holder and the camera. Eventually, it would take about 15 min to draw one up. This is because the flange plate is always the same, The tube’s height and width are constant. The closest part of the tube to the window surface is a constant 20mm. Horizontal and vertical angles vary from 10° to 30° in 5° intervals. After a custom holder is drawn, it would be exported to an STL format file.
To make these Sq Tube Shield holders available to others not interested in the effort to draw one up, I have set up a master folder holding 110 STL files that cover any holder with a compound angle from 10° to 30° left and right and up or down. There are also 10 STL files of holders with a single angle from 0° to 45° in 5° intervals.
Below is the link to the master file:
Master File of Sq Tube Shield Camera Holders

The master file also contains paper transit instructions and PDF protractors as well as STL files for the Filler Plate and Cord Anchor.

Below is a picture group that shows an easy and accurate way of obtaining the needed aim angles with a paper transit. The angle values would be rounded to the nearest 5°.

My thoughts about your curvey-sided rectangle has to do with a spherical surfaced camera lens and a flat image sensor surface. Look at the picture below. In reality, the edges of the patio cover and deck, the fence boards, and the angle labeled shield lines are all straight. And some are also parallel. The picture only has two straight lines: the horizontal top of the fence and the vertical side of the patio cover post. These two lines cross at a right angle very close to the center of the picture. Everything that is parallel to these two lines appears to be curved, and the curvature increases as they near the edges of the picture. If the image sensor were spherically shaped such as if found in our eyes we wouldn’t be seeing these curved lines.

Your thoughts about creating an OpenSCAD script to generate custom-aimed camera supports could be very useful.

Below is a picture group of a PLA 3D printed Dog Leg camera support generated with an Excel spreadsheet. Inputs are camera type, horizontal aim angle, and vertical angle. Output is the STL print file.

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Customer, please check the picture and link below.

Official Wyze V3 Window Mount is Live (just hidden at time of writing)
The billow’s picture is a static picture, not a video.


The billows size needed for a V3 would be about 6"x6" with the camera placed tightly into a corner of it. The corner of the camera that is nested in the billow’s corner will touch the face of the window. The area between the free sides of the camera and the billows (a thick right-angle shape or L) would be covered over with a similarly shaped piece of poster board or cardboard. Tape the billows to the window where the camera is needed.

Live-aim the camera, and maintain the aim in the billows by gluing lengths of wood crafts sticks (popsicle sticks) across the billow’s pleats near its corners.

The nearest picture of this below is of a large Sq Tube Shield. The conformed billows would replace the large outer tube.

Victor.

8 Likes

WOW!!! :star_struck:

You put a TON of effort into that post! Awesome models and 3D printing you did there!

:clap::clap::clap::clap:

5 Likes

Victor delivers. He is amazing.

6 Likes

Thanks for the write up! Holy smokes! @victormaletic getting it done! Nice!

RUhI

5 Likes

@victormaletic I am as shocked as I am humbled by your response. The amount of detail and precision is amazing. You more or less built what I could only imagine. If there are more people like you in this world, I can have faith that humanity will one day leave the solar system, to colonize the galaxy.

If you’re anywhere near KC and enjoy beer, I owe you a cold one, or a few!

I’ve been using my library’s 3d printer myself. Just today in fact, I was printing some test fits for the rectangular tubes you created to hold the camera. And when I got home I revised that project to (hopefully) have my first straight-on angled window mount, but it’s slow moving as I can only make it to the library makerspace once a week. Even though that’s not really much of an accomplishment since there’s a couple “straight on” holders like that already on thingiverse…

I just wish I had a working instance of Fusion360. i’ve been spending most my time in TinkerCad. Fusion doesn’t run well on my OS, Linux. I will share m works on this thread to collaborate and help others, but right now I’m still digesting all the material you posted in Google Drive. Your post was EPIC. Thank you!!!

4 Likes

Try FreeCAD, I just discovered it recently. Its much more complicated than TinkerCAD, and goes about design in a completely different way. suggest watching some videos before diving into it, but its really powerful and lets you polish objects very nicely.

1 Like

@BillyCroan , @Omgitstony , @IEatBeans , and @Customer.

Thank you for your warm :heart:ed comments.

4 Likes

Always impressed with your write ups and tutorials!

3 Likes

@BillyCroan and Everyone else.
Billy, thanks for your kind comments in post #7.
In this post, you mention using the library facilities for printing some of the rectangular tube/shield camera mounts. Did the mounts accept the cameras nicely, and was it a straight-ahead aim, a single angle aim, or a compound aim angle?
I have worked with three libraries in my area and found the print output quality between them varies from a tight fit requiring surface scraping with a pocket knife or a file to just a little deburring for a nice fit. Sometimes I think the printed deficiencies may kids bumping the printer when no one is looking.
I request that the library print my items with a medium or high-quality setting. If scraping is required to get a nice slip fit, only the first 20mm at the top of the square tube engages the camera. I wouldn’t scrape deeper than about 23mm. The design opening in the mount to receive the camera is about 0.25mm larger in both width and height. I also apply what I call a “stair-step additive correction “to the width and height opening for the camera. Printed items almost always require some cleanup, mostly minor. Along with a sharp knife and nippers, I also found the three tools shown in the group picture below very useful.

I have donated deburring tools to some of the libraries. The library staff would clean up the kid’s printed projects because of potential liability with kids and knives. Letting the kids use the deburring tools (because they are very safe), frees the library staff from print clean-up activities, and I seem to get print requests executed sooner.

Some of the initial fit-up problems I had with the early printed square tube shield camera supports did not take into account how aim angles affect the fit-up. Below is a diagram (not to scale) that depicts stair-step interference and how I calculated a correction that I added to the design tube opening dimensions. Only High School trig is required.

BillyCroan I am interested in what STL files I provided and how the cameras fit?

Later, Victor.

3 Likes

I may be a little slow on these projects. I only visit the library once a week, so iteration is… cumbersome.

I downloaded your g-drive folder mentioned earlier in this thread as a zipfile.

I didn’t build the protractor, though those instructions were well written.

Instead since I already had WyzeCams in place that I didn’t want to disturb, so I photographed my existing properly aligned WyzeCams straight down and straight horizontally, with myandroid phone held steady against the window and phone’s camera lens directly above or to the side of an edge whose H or V angle component I wanted to measure. Then I took those photos into “the GIMP” and rotated them until the WyzeCam’s edges lined up with windows to get my exact angles!

I have at least two cameras on each window btw, to capture the widest view, and serve as a backup.

Left cam:
right 18.8 degrees in gimp
down 12.19 degrees n gimp

Right cam:
left 24.01
down 4.82

Before I figured to use GIMP, I was actually viewing the photo and using a camera-protractor android app on my phone to measure, but I realized the screen to phone angle and maybe the way I was holding the phone itself was screwing up the measurements. And it felt a bit stupid to be pointing a camera at my laptop screen. A bit like printing something out so I can scan it in…

The STLs of yours I used were:

  • Square Tube 20°Rt 10°Dn Shield.stl
  • Square Tube 25°Lt 10°Dn Shield.stl

I made a folder to share my files too: Index of /WyzeForum236628Assets

I used PrusaSlicer to plate them up with some others :slight_smile: gcode file included.
They were each 4mm or so too large to print separately on a Prusa i3 MK3S but that was fine. I wanted them as one piece anyway and just overlapped them as necessary to fit on the build plate and they came out as one piece.


CAME OUT WONDERFULLY, no deburring required on this part, in the angles I used. Here’s a video of the fit!

Let me know if I could help by running off prints of a variety of angles to test fit them. I don’t pay anything other than my property taxes to use this printer, but if you don’t need the confirmation I’ll save the filament for something else.

If you’d be willing to share your “source code” for the angled v3-to-window STLs, I’d like to build upon it. I want to make an version that has room for the v3 base, and another version for the v2 cameras since I still have a few of those. (I am progressing currently on a v2 straight-on-window adapter in TinkerCad.) I’d also like to add the option to rotate the WyzeCam’s tube on it’s axis. I’ve done this before to help motion boundaries line up with sidewalks/streets, etc.

I really want to make a ‘generator’ for these STLs, where you key in the H V and rotation angles, and select which camera you want, and it pops out the STL you need.

I printed your v3 base filler plate, and it came out okay. I had to debur it quite a bit but I probably shouldn’t have printed that with a brim so that’s on me. Otherwise, deburred, it snaps right into place!

I modified the v3 base filler plate STL you designed so I could keep the screw in the camera so I am less likely to lose it, and access the sd and programming button without removing it. I put a keyhole on there too because why not. My Wyze Cam Window adapters are on tinker cad at Login | Tinkercad and I exported stl, glb, and obj files of it in my asset folder. I may revise them but I typically keep older revs in Tinkercad, just further out of the workplane.

I’m also thinking of painting the white plastic on the fronts of the wyzecams black to further reduce the chance for reflections, and make it look nicer outside.

5 Likes

Hello All and @BillyCroan
Thank you BillyCroan for your compliments.
That’s a neat idea to use a camera to capture camera aim geometry, and then use the GIMP program to measure the aim angles.

The PrusaSlicer worked well with good output. No need to waste filament on check prints.

I am impressed with your informative video showing print fit up with the camera.

I find that the screw for the camera’s base is attracted strongly to its base and very secure when folded within it.

The hole in the base filler plate is for mounting the camera on non-magnetic surfaces, an example is shown below.

There is no source code to share. The STL files for all aim angle combinations of the Sq. Tube Glare Shield holders come from four basic solids that are nested, rotated about two axes, subtracted, and unionized. After the aim rotations are completed would be a good time to apply a window normal rotation. All of the four basic solids came from extruded polyline shapes. The trick to getting the proper tube length is to know where to position the horz and vert axes of the tube, only simple trig, multiplication, and additions involving the specific aim angles are required.

I will post my procedure in detail soon. I hope you will be able to incorporate my procedure into an automated generator. I would like to have a copy of the generator when you finish it. Below is the printed output from my spreadsheet-generated STL file for a DogLeg support bracket.

Your idea of making Sq, Tube Glare shields for the V2 and the V3 with their bases attached is very good and accommodates those who do not want to take parts off of their cameras. I think making the tube an extra 5mm would provide better support and make it look better. This full-camera approach would be heavier and a cord anchor could share some of the load.

Or

Their STL files are in the Google Drive Master File

Victor.

4 Likes

I got bogged down with other stuff, but will make progress on this in the next week. Is your spreadsheet public that generates an STL file? I’d love to see that formula! Seriously would probably help me make the new generators too.

Hello to All and @BillyCroan
I have been asked if I would share my source code for 3D printing custom window-mounted Sq Tube Glare Shield V3 camera holders. There is no source code, but I will share my procedures and methods. Perhaps they will provide a path for someone to automate it. My method of creating a 3-D model which can be exported to an STL file and then 3D printed is described below in detail. Also, the method is available as a word document. With the word document, you can write in your aiming angles and use it in the detailed math expressions, and easily switch between pages to gain an understanding of the simplicity of this method.

Here is how a practical person might describe in words what I am going to present below.
Imagine you have a magical square tube that a V3 camera (without its base) will fit snuggly into the end of the tube 20mm. Because the tube is magical it will pass through the window without damage, But the camera is not magical and will be stopped by the window. So you start moving the tube through the window until the camera is stopped by the window, Now you aim the camera to the right and then down to your aim area of interest, now only the upper left corner of the camera is touching the window. Now with a very sharp knife, cut off the portion of the magic tube beyond the front face of the window. The remaining tube against the window is no longer magical. With some strips of thin material you previously prepared, Glue a brim around the sides of the tube that is against the window face. It kind of looks like a miniature hat with a hole on the top for the camera. This is a description of what my method is with the necessary details to accomplish it.

Victor’s Method of drawing up the solid for a through-a-window-view of a Square Tube Glare Shield V3 Camera Holder. Here is the link.

Sq Tube Glare Shield Drawing Instructions

I use AutoCAD for my drawing, but since the simplest drawing commands: JOIN, EXTRUDE, UNION, ROTATE3D, and SUBTRACT are all that is needed and available in any basic 3D drawing program. 2D drawing is also needed to draw the part sections that will be the basis of the solids extruded from them which will then be further 3D manipulated. After drawing a part, you may need a lefthand version of it. No need to repeat the drawing process, instead to a MIRROR3D command. MIRROR3D can also be used to mirror an up-version from a down-version. After the 3D drawing of the part has been completed and checked, it can be exported to an STL file and 3D printed. A printed example is pictured below.
People using more advanced software will see easier and more advanced procedures to accomplish the same end result.

This camera holder/glare shield is made from 3 solids and a fourth solid that I call a Subtraction Block. This block is used to help form the part, but is not part of finished product.
The Window Plate is two simple extruded plates that are then unionized.

To create a printable part that the camera will fit into with little or no cleanup work after it is printed some details will need to be attended to. Physically measure the V3 camera with machinist calipers. I prefer digital ones that can measure in millimeters or inches. I add 0.25mm to the length and width of openings that will be receiving the camera. Also, if the camera tube will be printed at an angle to the 3D printer plate, I add my so-called stair-step correction, which is covered on the next page.
The wall thickness of this part is somewhat arbitrary. The thickness needs to be thick enough to print nicely and to carry the camera’s weight. To make the part easier for the printer to print, consider using discreet multiples of the printer’s table motion resolution.

This sheet details how fit-up interference arises when printing a sloped surface. Printing on a slope creates a series of stacked and offset layers. The cross-sectional shapes of these print strings are really more rounded or elliptical. The squared-off shapes in the drawing below provides a mathematical approach that gives numerical values that can be incorporated into the part’s dimensions. I think it is better to have a little looser fit-up than a tight one. Loose fits can be shimmed out with tape applied in the right places.

The Working Length is the amount of extrusion needed to properly sleeve (hold) the camera while holding it at the specified Horizontal and Vertical Aim Angles. One intent of the geometry for the Sq Tube Glare Shield is to have one corner of the camera touch the window with non-zero aim angles. Touching the window provides the least amount of field-of-view restriction resulting from aim angles greater than 20°. With both aim angles zero, the whole face of the camera touches the window. There are no field-of-view restrictions in this case.

image

The picture below shows the Working Length as it applies to this Sq Tube Glare Shield. It is the red arrow that extends along the tube’s centerline axis from the face of the window to the plane of the tube’s end. The length of the blue arrow represents the Sleeve Lap, and its length is included in the red arrow’s length.

image

In this depiction, the Inner and outer sections of the future tube are separated and multiple copies are made for the 3D manipulations to follow. Each of the sections has a centerline X and Y axis that lies on the zero plane (which is the surface of the window). When these shapes or the solids extruded from them are copied and moved about, the intersection point of the X and Y axes will be the grips by which they are moved, attached, unionized, rotated, and subtracted.

I proceed forward with the shape manipulation with copies of previous results as an insurance policy against my blunders and mistakes. It is easier for me to discard a mistake and resume from a previous state than to somehow undo it when I may not realize what I did and how to undo it.

P8 Extrusions-Model

This is an oblique view of the above extrusions that will be piggyback stacked and unionized.

In the oblique view below of the unionized solids below the X and Y axis within the solids will be the references for horizontal and vertical aim angles.

When selecting a solid for the horizontal aim angle rotation about its Y axis be sure to select the X axis segment to be included in the rotation. The rotation of this axis and the concept of Working Length are key in making the final finish geometry correct.
The lower 25° Dn view incorporates the 20° Rt 3D rotation from above. If you wanted an additional 3D rotation about the Z axis where it passes through the center point, this is where it would happen, after the Rt and Dn rotations. The views below are Z plane projections.

The two depictions below are where the Window Plate Solid and the Subtraction Block are copied and placed with the rotated Outer Solid at their center points.

The next operation will be the subtraction of the Subtraction Block from the rotated Outer Solid, and then unionizing the Window Plate and remainder of the Outer Solid.

In the figure below right, the Subtraction Block has been subtracted from the Outer Solid. The remaining Outer Solid and Window Plate are unionized.

Above a copy of the Inner Solid has been moved to the recently unionized solid on the right using center-to-center positioning. The Inner Solid will be subtracted from the unionized solid.

The last subtraction results in the finished part. Before exporting it to an STL file and 3D printing it, run some checks.

Below is an oblique wireframe view of the finished part.

image

image

![image|672x353](upload://kpREmXWWav33ELKOyCOKdEIAvwS.png

Not shown here, the wireframe was 3D manipulated to obtain a Working Length measurement it checked out to four decimal places.

This is the finished part holding a camera. This version of it requires that the base be removed. A 3D printed filler plate fills in the notch left from the base removal, also printed is a cord holder to take most of the cord’s weight.

5 Likes

Hello BillyCroan
Here is a link from one of my earlier post:
Spreadsheet to 3D Printed Ready to Mount DogLeg Bracket
That may help you.
You may find as I did that once one gets beyond simple geometric shapes such as my dogleg camera supports. The vast amount of triangles needed to describe these shapes become a tyranny of numbers. In my dogleg mounts, I was able to map out all of the triangles and link them to specific parts of the spreadsheet.
Good luck, I am interested in what you come up with.

Victor.

2 Likes

Hello Rulwiz.
The link in the post is for a free spreadsheet wherein you specify the horizontal and vertical aim angles and the bracket thickness usually 8mm and get values that you copy and save as an STL file that the 3D print is made from.
Here is a free link to the spreadsheet. DogLeg Standup to STL

When you say where can I buy this? To what are you referring?

I’m not sure where you are, but US libraries 3D print STL files for free. I.e., take the STL file to the library and they’ll make this for you free of charge. Google your local libraries and search their sites for 3D printing for specifics and limitations.

3 Likes