Using QCAD or Inkspace to get details into OpenSCAD?

classic Classic list List threaded Threaded
36 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Using QCAD or Inkspace to get details into OpenSCAD?

Terrypin
Any QCAD and/or Inkscape users here please? I've recently registered with the QCAD forum for help in using either with OpenSCAD.

I'm getting very helpful replies. But there's a natural temptation to tell me more than I want to learn ;-)

So I'm hoping that some here may have know-how which is similarly focused. Particularly on getting precise measurements from a photo into OpenSCAD when accurate physical measurements with ruler and calipers are difficult.

Here's the link:

https://qcad.org/rsforum/viewtopic.php?f=32&t=8475&p=33484#p33484

I suspect it might be more helpful of me to duplicate here at least the details I provided. But I'll await initial feedback.

Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

jon_bondy

I found it pretty easy to load a JPG image into InkScape and then click on a series of points around the object of interest to create a Bezier curve.  If you poke around, it should take you just 10 minutes or so to figure it out.  If not, get in touch with me and I can provide step-by-step instructions.

On 6/1/2021 8:32 AM, Terrypin wrote:
Any QCAD and/or Inkscape users here please? I've recently registered with the QCAD forum for help in using either with OpenSCAD.

I'm getting very helpful replies. But there's a natural temptation to tell me more than I want to learn ;-)

So I'm hoping that some here may have know-how which is similarly focused. Particularly on getting precise measurements from a photo into OpenSCAD when accurate physical measurements with ruler and calipers are difficult.

Here's the link:

https://qcad.org/rsforum/viewtopic.php?f=32&t=8475&p=33484#p33484

I suspect it might be more helpful of me to duplicate here at least the details I provided. But I'll await initial feedback.

Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

Terrypin
Thanks Jon, appreciate the fast reply, that’s Reassuring and I’ll try it shortly.

But I’ve left Inkscape till slightly later because I understand that it can do the job automatically, i.e without any manual clicking, by using Trace Bitmap?

QCAD on the other hand does require user drawing. My initial attempts with that have failed, as you may have seen from my posts. Apart from the initial frustration of getting my image visible, I’ve not yet found the right combination and sequence of tools.

Terry

I

Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

OpenSCAD mailing list-2
In reply to this post by Terrypin
I wrote a bit about re-drawing from a scan/photo using Carbide Create (the free license) at:

https://community.carbide3d.com/t/importing-a-file-or-a-backgound-image/27166

the concepts should apply to pretty much any vector editor such as Inkscape or to a formal CAD app such as QCAD or LibreCAD.

I've found measuring w/ a pair of calipers and making a scaled file and then upscaling works pretty well though --- just input into one variable, then multiply all by the necessary scale factor and use the multiplied ones.

William


-----Original Message-----
From: Terrypin <[hidden email]>
To: [hidden email]
Sent: Tue, Jun 1, 2021 8:32 am
Subject: [OpenSCAD] Using QCAD or Inkspace to get details into OpenSCAD?

Any QCAD and/or Inkscape users here please? I've recently registered with the QCAD forum for help in using either with OpenSCAD.

I'm getting very helpful replies. But there's a natural temptation to tell me more than I want to learn ;-)

So I'm hoping that some here may have know-how which is similarly focused. Particularly on getting precise measurements from a photo into OpenSCAD when accurate physical measurements with ruler and calipers are difficult.

Here's the link:

https://qcad.org/rsforum/viewtopic.php?f=32&t=8475&p=33484#p33484

I suspect it might be more helpful of me to duplicate here at least the details I provided. But I'll await initial feedback.

Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

nophead
In reply to this post by Terrypin
I use this plugin with InkScape and a 2D scanner to get the outline of objects as a polygon: https://www.thingiverse.com/thing:25036

On Tue, 1 Jun 2021 at 14:46, Terrypin <[hidden email]> wrote:
Thanks Jon, appreciate the fast reply, that’s Reassuring and I’ll try it shortly.

But I’ve left Inkscape till slightly later because I understand that it can do the job automatically, i.e without any manual clicking, by using Trace Bitmap?

QCAD on the other hand does require user drawing. My initial attempts with that have failed, as you may have seen from my posts. Apart from the initial frustration of getting my image visible, I’ve not yet found the right combination and sequence of tools.

Terry

I

Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

MathLover
In reply to this post by Terrypin
I use the combination of LibreCad (QCAD fork) and OpenSCAD a lot. I usually draw an outline that I can extrude or rotate into a 3D object and do that in a few dimensions so I can do boolean operations with them.

This is quite a bit of a learning curve if you are not familiar with 2D CAD.

In relation to OpenSCAD, every outline or dimension you want to use should be on a separate layer in the QCAD / LibreCad file. It helps if you give the different layers a different colour, so you can see what's on which layer.

Also, take notice of the snap options. If the lines in a corner do not exactly end at the same point, OpenSCAD will not see it as part of an outline.

Because of the learning curve, I would suggest to start simple. One of the advantages of CAD is that you can edit the files. So model the plate as a rectangle, and extrude that into OpenSCAD.

Then draw a trapezoid for the nozzle, and rotate-extrude that into OpenSCAD as well.

Combine those two.

You have now probably found out that it is handy to define an origin. OpenSCAD gives you that option by reading a point from the intersection of two lines in the dxf (QCAD / LibreCad) file. Draw those lines on yet another layer.

If you can get a 3D object out of this, go back to the dxf file and refine the plate part and the nozzle part using commands like copy, fillet, etc.

Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

mondo
In reply to this post by Terrypin

Use a flat bed scanner, if available, and include a 6 inch ruler, say, so you can confirm the size.

On 01/06/2021 13:32, Terrypin wrote:
Any QCAD and/or Inkscape users here please? I've recently registered with the QCAD forum for help in using either with OpenSCAD.

I'm getting very helpful replies. But there's a natural temptation to tell me more than I want to learn ;-)

So I'm hoping that some here may have know-how which is similarly focused. Particularly on getting precise measurements from a photo into OpenSCAD when accurate physical measurements with ruler and calipers are difficult.

Here's the link:

https://qcad.org/rsforum/viewtopic.php?f=32&t=8475&p=33484#p33484

I suspect it might be more helpful of me to duplicate here at least the details I provided. But I'll await initial feedback.

Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

JordanBrown
In reply to this post by jon_bondy
On 6/1/2021 5:43 AM, jon wrote:

I found it pretty easy to load a JPG image into InkScape and then click on a series of points around the object of interest to create a Bezier curve.  If you poke around, it should take you just 10 minutes or so to figure it out.  If not, get in touch with me and I can provide step-by-step instructions.


I've had good results with doing that (although I use CorelDraw) and then transcribing the resulting coordinates into my OpenSCAD program's Bezier calls.

I had to be really careful about getting the image to match the scale of the drawing.


_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

jon_bondy
I didn't have to transcribe anything: I just exported a DXF and imported
that into OpenSCAD.  You can use scale() to recover from scaling errors
fairly easily

Jon

On 6/1/2021 5:48 PM, Jordan Brown wrote:

> On 6/1/2021 5:43 AM, jon wrote:
>>
>> I found it pretty easy to load a JPG image into InkScape and then
>> click on a series of points around the object of interest to create a
>> Bezier curve.  If you poke around, it should take you just 10 minutes
>> or so to figure it out.  If not, get in touch with me and I can
>> provide step-by-step instructions.
>>
>
> I've had good results with doing that (although I use CorelDraw) and
> then transcribing the resulting coordinates into my OpenSCAD program's
> Bezier calls.
>
> I had to be really careful about getting the image to match the scale
> of the drawing.
>
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

JordanBrown
On 6/1/2021 3:13 PM, jon wrote:
I didn't have to transcribe anything: I just exported a DXF and imported that into OpenSCAD.

That works for some applications, but not for others.  My project was generally standard OpenSCAD geometry (based off of the dimensions of the object I was modeling), but for one curvy section I needed something more.  I could probably have done it with a DXF import, but it was easier to do by transcribing the control point coordinates.

I was modelling a steam shower-bath unit; the curvy part was the bathtub part and so I wanted to model both the curve around the top of the bathtub and the curve around the bottom.  I probably could have created DXF drawings for the two curves, and hulled them to create an object to subtract away, but that seemed harder.

I still had a hull-related issue; the tub was slightly concave at one point and the hull that I used to connect the two curves chopped that off.  I didn't feel like spending the effort to get it exactly right.

You can use scale() to recover from scaling errors fairly easily

Well, kind of.  Again, it depends on the application.  I'm building scale models, so I care that my model's size matches the size of the object being modeled.  Scale() only helps if I know the various dimensions so that I can calculate the required scale... and if I know the various dimensions, I might as well make the scale be correct in the first place.

What I did was to set CorelDraw up so that the rulers were in units of inches (on the object being modeled), then import the image and scale it so that known dimensions matched the rulers, and put the origin at a convenient place.  Then I traced the key curvy parts with Bezier curves, and read off the control-point coordinates.

Here's pictures.  (I knew you would be thrilled :-)  This is for a possible bathroom remodel, not what's actually in the house, and so I didn't go to my usual level of detail.




Mesa 807A Steam Shower Tub Combo 67"L x 35"W x
      86"H
Mesa 807A Steam Shower Tub Combo 67"L x 35"W x
      86"H

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

shadowwynd
In reply to this post by jon_bondy
The key is having an accurate sense of scale.  My preferred way is to use a flatbed scanner (or a copier with scan feature, if I am at work) with the part of which I need (e.g. hole placement, complex curves, etc.) but to also include a rectangular scale model (such as a credit card - something that I can easily measure and get exact dimensions on).  If I am starting from a photo then I try to take the photo as orthogonal as possible, but the camera skew makes this really difficult.  

In practice, most of the scanners I have used have some autoscale involved that throws things by a centimeter, which is why having a scale reference is important.  I then open the scan in inkscape, draw a matching scale rectangle based on measured dimensions (e.g. a typical credit card is 85.6mm x 53.98 mm, so I would draw a rectangle that size in inkscape (with no outer line, as that adds thickness, and lower the opacity to say 50%) and then scale the scan so that it matches the size of the scale model.  

If the part you are tracing is thin enough that you can shut the scanner bed, you should have high contrast between part and background and then the "Path-->Trace Bitmap should work very well.  If the part sticks up enough that you can't shut the scanner, I use the Freehand Line tool to trace the outline (50% opacity trick works here also) and then Node Edit to get the points where I need.  

The newer versions of OpenSCAD can import SVG files, otherwise you need to use DXF.  Especially when using DXF, I do Extensions-->Modify Path-->Flatten Beziers  with angularity of 0.1 or so (OpenSCAD tends not to like curves in a DXF, so converting a curve to a LOT of small line segments helps).

On importing the SVG/DXF into OpenSCAD (leave the file open in Inkscape), I leave the scale model (at least at first).  I make a simple square in OpenSCAD that matches the (credit card or whatever) dimensions and make sure that the size still matches and I don't need to scale or resize it (Inkscape recently changed their default DPI and broke Inkscape OpenSCAD export tool I used, and I haven't checked if it has been updated yet, and I have seen both DXF and SVG be drawn in a "wrong" size, so having a second size check saves hair-pulling.

Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

Alan Cox-2
In reply to this post by Terrypin
On Tue, 1 Jun 2021 06:46:03 -0700 (MST)
Terrypin <[hidden email]> wrote:

> Thanks Jon, appreciate the fast reply, that’s Reassuring and I’ll try it
> shortly.
>
> But I’ve left Inkscape till slightly later because I understand that it can
> do the job automatically, i.e without any manual clicking, by using Trace
> Bitmap?

Inkscape can generate vector traces from a bitmap. The potrace command
line tool on Linux can do likewise and turn a bitmap into eps.

My own tool chain uses 1200dpi scans, potrace -r 1200 and pstoedit -nc -f
xfig together to generate an xfig file of the trace so it's easy to parse
then just import that as a polygon and centre it.

Alan
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

Terrypin
In reply to this post by shadowwynd
My thanks to all for the further suggestions. Much to study!

Howver I have made some progress as described a few minutes ago in the QCAD forum - which now appears focused largely on Inkspace! But I'll now paste here for convenience:

Starting from my edited profile photo opened in Inkspace...



... I played with various settings of Trace Bitmap...



... and saved it as an SVG



I've posted separately asking how to 'square up' my view.

And I have yet to play with 'scaling', 'upscaling'. etc.

Terry


Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

Terrypin
In reply to this post by Terrypin
I've uploaded the edited photo here in case anyone else wants to extract a 'better' SVG from it.

https://www.dropbox.com/s/wnbkpxans1kmed6/EditedPhoto.png?dl=0httraw=1

Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

GeoffHorton
If you're going to try to print the results with an FDM printer, that jagged edge is going to drive it nuts.




_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

Terrypin
Don’t forget the thickness is a only 2 mm. Visually, my rough guess at the depth of the ‘jagged edge’ would be say 0.01- 0.02 mm. Far lower than the 0.16 or 0.28 resolutions of my Ender 3 V2 at high and low quality settings respectively.

But I agree that perfectly straight lines would be desirable. I have yet to try drawing those in Inkscape. But I hope that now I have determined the dimensions more accurately I should be able to proceed exclusively in OpenSCAD.

Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

nophead
You might be able to smooth it by offsetting outwards and inwards by the same amount.

On Wed, 2 Jun 2021 at 22:47, Terrypin <[hidden email]> wrote:
Don’t forget the thickness is a only 2 mm. Visually, my rough guess at the depth of the ‘jagged edge’ would be say 0.01- 0.02 mm. Far lower than the 0.16 or 0.28 resolutions of my Ender 3 V2 at high and low quality settings respectively.

But I agree that perfectly straight lines would be desirable. I have yet to try drawing those in Inkscape. But I hope that now I have determined the dimensions more accurately I should be able to proceed exclusively in OpenSCAD.

Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

mondo
In reply to this post by Terrypin

Hi, I'm uncertain as to what you are trying to do. Is it to 3d print, as near as possible a copy of the original item (the photo of the white object you posted earlier on?) Or is it to get a 2mm high 'outline ' of the edge of the object? How accurate has it got to be? If you are trying to match an existing object, then print two, and replace the original original, they'll both look the same. If it is to model the orange outline, 2mm high, then in open scad, a few 'squares', and 'rounded corner' will do it, more or less (or is 'more or less' not good enough, or am I completely barking up the wrong tree?)

Best wishes,

Ray

On 02/06/2021 22:47, Terrypin wrote:
Don’t forget the thickness is a only 2 mm. Visually, my rough guess at the depth of the ‘jagged edge’ would be say 0.01- 0.02 mm. Far lower than the 0.16 or 0.28 resolutions of my Ender 3 V2 at high and low quality settings respectively.

But I agree that perfectly straight lines would be desirable. I have yet to try drawing those in Inkscape. But I hope that now I have determined the dimensions more accurately I should be able to proceed exclusively in OpenSCAD.

Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
dpa
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

dpa
I don't understand how you can discuss this for so long. It is so simple. I have made an example video. Of course you have to set the strokes a little more precisely but it is so easy to draw something and then extrude it in openscad.

- draw something in inkscape
- save it in a folder
- in same folder make the scad file
- scad import the svg file and extrude it
- load/update in OpenSCAD


Am Do., 3. Juni 2021 um 00:33 Uhr schrieb Ray West <[hidden email]>:

Hi, I'm uncertain as to what you are trying to do. Is it to 3d print, as near as possible a copy of the original item (the photo of the white object you posted earlier on?) Or is it to get a 2mm high 'outline ' of the edge of the object? How accurate has it got to be? If you are trying to match an existing object, then print two, and replace the original original, they'll both look the same. If it is to model the orange outline, 2mm high, then in open scad, a few 'squares', and 'rounded corner' will do it, more or less (or is 'more or less' not good enough, or am I completely barking up the wrong tree?)

Best wishes,

Ray

On 02/06/2021 22:47, Terrypin wrote:
Don’t forget the thickness is a only 2 mm. Visually, my rough guess at the depth of the ‘jagged edge’ would be say 0.01- 0.02 mm. Far lower than the 0.16 or 0.28 resolutions of my Ender 3 V2 at high and low quality settings respectively.

But I agree that perfectly straight lines would be desirable. I have yet to try drawing those in Inkscape. But I hope that now I have determined the dimensions more accurately I should be able to proceed exclusively in OpenSCAD.

Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using QCAD or Inkspace to get details into OpenSCAD?

JordanBrown
On 6/2/2021 6:02 PM, dpa wrote:
I don't understand how you can discuss this for so long.

The devil is in the details.  Indeed, importing an Inkscape drawing isn't terribly difficult.

The original request wasn't to draw something in Inkscape and then extrude it in OpenSCAD... it was to start with a photo and somehow turn that into an OpenSCAD object.  The most likely process involves bringing the photo into Inkscape, tracing it there (either with automatic trace tools or by hand), then carrying that drawing into OpenSCAD.

Then you have to add onto that getting the scale right, which probably involves matching up features in the scan with Inkscape rulers, and may involve adding reference features like rulers to the scan.

Then there's questions of whether you need more than one Inkscape drawing, and whether you want to keep those Inkscape drawings around as part of the "source" of the model, or if you want a pure-OpenSCAD answer.

And for each of those there are multiple techniques, none of them right or wrong, just different, each with its own advantages and disadvantages.


_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
12