Beginner's problems designing a fake fingernail

92 views
Skip to first unread message

Phil Kregor

unread,
Oct 14, 2025, 6:03:11 PM10/14/25
to CadQuery

I am new to 3D and am a classical guitarist with bad fingernails, so I have to use fake nails.  The fake nails that I buy require a lot of trimming, so I want to design a nail that fits my fingers without modification.

I design the nails in 2 ways.  Method 1 uses a 3-point arc to shape the nail and the code is as follows:

import cadquery as cq
result = (cq.Workplane().moveTo(0,8).lineTo(10,8).threePointArc((18,0),(10,-8)).lineTo(0,-8))
result = result.close()
result = result.extrude(0.7) #Nail thickness

which produces the following result:

It looks like a fingernail, but doesn’t curve around the finger.  It’s too flat.

Method 2 uses 2 circles and the code is as follows:

import cadquery as cq

result =(cq.Workplane().circle(4).circle(3).extrude(8).moveTo(4,0).rect(8,8).cutBlind(12))

which produces the following result:

It looks like a fingernail, but I don’t know how to trim the top so that it has the curve of the nail at the end of the finger.

If either of the above ways is close, any comments on how to complete the fingernail would be appreciated.  If I’m totally off base, please suggest another approach.


Thanks 

Jeremy Wright

unread,
Oct 15, 2025, 9:11:56 AM10/15/25
to Phil Kregor, CadQuery
Your images do not show up for me, but I can guess what you're looking for based on the shape of a fingernail. You might want to look into the Free Function API, specifically this from the Free Function API: https://cadquery.readthedocs.io/en/latest/free-func.html#mapping-onto-parametric-space

That API is still experimental, but notice in the example how the cylinder is used to construct curved shapes. I am thinking that the cylinder would work well as an analogue to a finger and the constructed shapes would be your pick.



--
cadquery home: https://github.com/CadQuery/cadquery
post issues at https://github.com/CadQuery/cadquery/issues
run it at home at : https://github.com/CadQuery/CQ-editor
---
You received this message because you are subscribed to the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cadquery/d91c140e-8eae-45d0-b766-3a64d489a267n%40googlegroups.com.

Phil Kregor

unread,
Nov 7, 2025, 4:24:41 PM11/7/25
to CadQuery
Jeremy, Thanks for your help.  I have made a lot of progress on this.   Now, however, I need to put a letter on each fingernail to tell which finger 
the nail goes on ("M", "I". "R". etc).  I can't get the letter to appear in the correct position and with the correct proportions. 
I combined two Cadquery free API examples to make this small program serve as an example of my problem:
 
from math import pi
from cadquery.func import cylinder, edgeOn, compound, wire, extrude, text, faceOn, fuse
from cadquery import exporters
from cadquery.vis import show

base = cylinder(16, 18).faces("%CYLINDER") # construct the base surface
nail = base.trim((0,0), (pi,0), (pi/2, 9)) # polyline trim
nailf = faceOn(nail, text("M", 1))
fusednail=fuse(nailf,nail)
show(fusednail)
#Give it a little thickness
fusednailex = extrude(fusednail,(0,2,0))
show(fusednailex)
exporters.export(fusednailex, 'fusednailex.stl')

fusednail looks like this:

fusednail.jpg
and fusednailex looks like this:
fusednailex.jpg

Lots of problems and questions here:
1.  How do I get the "M" to appear in the center of the nail?  I tried the valign and halign parameters of text, but they don't help.
 I've also tried defining a new workplane on the face of the nail and putting text there and that seems to work, but I can't fuse 
or join or union the 2 together like I can above,
2.  How do I get the "M" to have correct proportions?  It's now way too wide and way to short.
3.  After I fuse the "M" to the nail, I extrude them as one object.  Will the "M" have any thickness of its own and will it even show up
when I print the nail?  Do I need to change its color (not sure how to do that).

Thanks

Adam Urbanczyk

unread,
Nov 9, 2025, 4:24:25 AM11/9/25
to CadQuery
I'd use a different approach for text:

from math import pi
from cadquery.func import *

from cadquery import exporters
from cadquery.vis import show

base = cylinder(16, 18).faces("%CYLINDER") # construct the base surface
nail = base.trim((0,0), (pi,0), (pi/2, 9)) # polyline trim
spine = edgeOn(base, [(pi/2, 2), (pi/2 + 0.5, 2)])


txt = text("M", 4, spine)
fusednail = clean(offset(nail, 0.1, both=True)) + offset(txt, 0.15)

show(fusednail)

Jeremy Wright

unread,
Nov 9, 2025, 1:11:49 PM11/9/25
to Adam Urbanczyk, CadQuery
FYI - Adam just fixed a bug with single letters that would probably apply to what you're doing. 


You'll need to pull the latest changes from git master to get the fix.

Jeremy

Phil Kregor

unread,
Nov 9, 2025, 3:13:03 PM11/9/25
to CadQuery
Thanks to both of you for your answers.  It's working fine now.

Phil Kregor

unread,
Feb 21, 2026, 9:26:13 PM (11 days ago) Feb 21
to CadQuery
After submitting my fingernails to printers, they always told me they were too thin to print.  After 2 months, I finally determined that I didn't have control over the thickness of the nail, like I thought I did.  

I think it boils down to 2 lines of code:

 base = cylinder(d, h)  # construct the base surface
 basef = base.faces("%CYLINDER") #Faces of cylinder

I want a cylinder thickness of 0.7mm, but I don't know how to specify it in the above code.  I tried shell() and thicken(), but get errors on both.  
Any suggestions appreciated.

Jeremy Wright

unread,
Feb 24, 2026, 9:00:38 AM (8 days ago) Feb 24
to Phil Kregor, CadQuery
Are you able to post your full code so that I can run it to see what's going on?

Phil Kregor

unread,
Feb 24, 2026, 8:50:04 PM (8 days ago) Feb 24
to CadQuery
Yes, here it is.  I have tried to "thicken" it up with extrude, but extrude says it encountered a solid, but was looking for wire, etc.

from math import pi
from cadquery.func import *
from cadquery.vis import show
from cadquery import exporters
C = 64   # Circumference of finger in mm
d = C /pi   #Diameter of cylinder in mm
h=18   #Height of cylinder is desired finger nail length in mm

base = cylinder(d, h)  # construct the base surface
basef = base.faces("%CYLINDER") #Faces of cylinder
U = pi/4.3  # The U coordinate in the next statement
pcurve = edgeOn(basef, [(0,0),
                       (-U,h/2),
                       (0,h),
                       (U,h/2),
                       (0,0)])
nc=basef.trim(wire(pcurve))  #Make the nail curvenc
spine = edgeOn(basef, [(0,18/4), (0.5,18/4)])  #Where to put the label on the nail
txt = text('TH', 3, spine)
fusednail = clean(offset(nc, 0.1, both=True)) + offset(txt, 0.15) #Text on nail tells which nail it is    
fusednail = fusednail.rotate((0,1,0),(0,-1,0),90) #004
show(fusednail)
exporters.export(fusednail,"TH" + '.stl')  

Adam Urbanczyk

unread,
Feb 26, 2026, 2:55:43 AM (7 days ago) Feb 26
to CadQuery
Your code works for me and the type of fusednail is Solid. I'm using CQ master right now, which version are you using?

Phil Kregor

unread,
Feb 26, 2026, 8:43:15 AM (6 days ago) Feb 26
to CadQuery
I'm using 2.6.0, installed in Nov 2025.  However, the code works for me also, but the thickness of the nail is not right.  I don't even know what the thickness is, because I never specified anything (at least I don't think I did).  When I look at the output nail, it appears to be about 0.3mm thick, but I want 0.7mm.  I've tried thicken, extrude, but get errors.
Thanks

Adam Urbanczyk

unread,
Feb 26, 2026, 1:21:06 PM (6 days ago) Feb 26
to CadQuery
You specified thickness to 0.2 when calling  offset(nc, 0.1, both=True) . In the code above offset produces a solid.

Phil Kregor

unread,
Feb 26, 2026, 2:42:45 PM (6 days ago) Feb 26
to CadQuery
Thanks, sorry I didn't see that.
Reply all
Reply to author
Forward
0 new messages