Connecting 3 dimensional points with a sketch?

I am trying to model a simple round diamond using KCL and I am having some trouble creating the facets. I have two sketches of octagons and one is translated down in the Z direction and it is inscribed in a circle of larger radius than the upper octagon. The lower octagon is then rotated 22.5 degrees such that the point of the upper octagon is aligned with the center of the edge of the lower octagon. I am trying to create the facet triangles between these octagons. For example you could connect vertex of the top octagon to the two vertexes connected to the edge of the bottom octagon to create one triangle. The triangle would be be leaning inwards with the base on the edge of the outer-lower octagon and the point touching the vertex of the upper-inner octagon.

I hope that makes sense.

I am having a lot of trouble figuring out how to connect these vertices in KCL since you need to define the plane of the sketch in 2-dimensional space (e.g. XY)? I did a little bit of reading on the custom planes but that would be a lot of work defining a custom plane for each of the 16 facet triangles?

Is there a best method to do something like this in KittyCad, or a specific page of the docs that would make this easier for me? If you use loft function you end up with a spiraling connection instead of a natural diamond facet.

Thank you

Hi @fireflame55,
Thanks for giving our software a go and reporting!

Trying to reproduce and understand your issue, can you confirm that this is the ouput you’re seeing when trying out a loft? And this isn’t the intended result as you would want triangular faces to make up the diamond side is that right?

Best,
Pierre

1 Like

Yes that is very close to what it looks like when I use the loft tool (radius should be larger than 10 on the bottom octagon).

Here is a very rough sketch of what the faceting is supposed to look like.

Ok thanks for confirming! There’s a chance that we have to resort to boolean operations here and patterns, either union or subtract depedending on the approach. I’ll check in with the others on the team if they have other ideas.

Hey @fireflame55 , we do have an update by using a function which creates a diamond slice and using the Circular Pattern to multiply it, here is the KCL code that you can paste into Zoo Design Studio:

sides = 8
baseHeight = 10
baseRadius = 10
bottomRadius = baseRadius / 1.25

fn polypoint(@index, radius, sides, offset) {
  travelAng = ((180deg / sides) * 2)
 return [cos((travelAng * index) + offset) * radius, sin((travelAng * index) + offset) * radius]
}

fn diamondSlice(@plane, args) {
  sketch001 = plane
  |> startProfile(at = polypoint(0, radius = args.radius.bottom, sides = args.sides.bottom, offset=args.offsetAng.bottom))
  |> line(endAbsolute = polypoint(1, radius = args.radius.bottom, sides = args.sides.bottom, offset=args.offsetAng.bottom))
  |> line(endAbsolute = polypoint(1, radius = 0, sides = args.sides.bottom, offset=args.offsetAng.bottom))
  |> close()
  
  sketch002 = startSketchOn(offsetPlane(plane, offset = args.height))
  |> startProfile(at = polypoint(0, radius = args.radius.top, sides = args.sides.top, offset=args.offsetAng.top))
  |> line(endAbsolute=polypoint(1, radius = args.radius.top, sides = args.sides.top, offset=args.offsetAng.top))
  |> line(endAbsolute=polypoint(1, radius = 0, sides = args.sides.top,  offset=args.offsetAng.top))
  |> close()
  
  slice = loft([sketch001, sketch002])
  return slice
}

baseArgs = {
 offsetAng = {
  top = 0deg,
  bottom = 0deg,
 },
 radius = {
   bottom = 0.1,
   top = baseRadius,
 },
 height = baseHeight,
 sides = {
  top = sides,
  bottom = sides,
 }
}

baseSlice = diamondSlice(startSketchOn(XY), args = baseArgs)
patternCircular3d(baseSlice, instances = sides, axis = [0, 0, 1], center = [0, 0, 0])

top1Args = {
 offsetAng = {
  top = 0deg,
  bottom = (180deg / sides) / 1.01,
 },
 radius = {
   bottom = bottomRadius,
   top = baseRadius,
 },
 height = baseHeight / 4,
 sides = {
  top = sides,
  bottom = sides * 100,
 }
}

topSlice1 = diamondSlice(startSketchOn(offsetPlane(-XY, offset = -(baseHeight + (baseHeight / 4)))), args = top1Args)
patternCircular3d(topSlice1, instances = sides, axis = [0, 0, 1], center = [0, 0, 0])


top2Args = {
 offsetAng = {
  top = 0deg,
  bottom = (180deg / sides) / 1.01,
 },
 radius = {
   top = bottomRadius,
   bottom = baseRadius,
 },
 height = baseHeight / 4,
 sides = {
  top = sides,
  bottom = sides * 100,
 }
}

topSlice2 = diamondSlice(startSketchOn(offsetPlane(XY, offset =(baseHeight))), args = top2Args)
patternCircular3d(topSlice2, instances = sides, axis = [0, 0, 1], center = [0, 0, 0])
|> rotate(roll = 0, pitch = 0, yaw = 180deg / sides)

Does that resemble what you’re aiming to achieve? Let us know!

Thanks,
Andrew

I apologize for the late response. The geometry of a real diamond is a little more complex, but I see how I could do it now. You really have to think in the KCL way rather than trying to replicate the steps I would take in a traditional CAD software.

What an interesting platform your team built. I work in jewelry manufacturing and I think this can be potentially game changing for my company. I’d love to jump on a video call to talk. What email should I reach out to?

I’m really glad you find it interesting!
Hopefully there will be even simpler solutions to your problem, we are still working on many aspects of our products.

I reached out to you in a DM about who to contact in an email.