I would like to add an image across the front of a curved face. I can’t seem to get this code to work correctly. Any Ideas?
model = Sketchup.active_model
entities = model.active_entities
# Add the face to the entities in the model
points = [
Geom::Point3d.new(0, -1200, 0),
Geom::Point3d.new(-5.43387120911019, -1189.44095529067, 0),
Geom::Point3d.new(-5.84558479587266, -1188.64091752703, 8.00040054321289),
Geom::Point3d.new(-0.41171347766655, -1199.19996244835, 8.00040054321289)
]
face = entities.add_face(points)
ptsSpine0 = []
ptsSpine0[0] = Geom::Point3d.new(0, -1200, 0)
ptsSpine0[1] = Geom::Point3d.new(3.2016, -1198.3524, 0)
ptsSpine0[2] = Geom::Point3d.new(32.5836, -1184.478, 0)
ptsSpine0[3] = Geom::Point3d.new(62.6604, -1172.184, 0)
ptsSpine0[4] = Geom::Point3d.new(93.3576, -1161.5364, 0)
ptsSpine0[5] = Geom::Point3d.new(124.5876, -1152.5652, 0)
ptsSpine0[6] = Geom::Point3d.new(156.2568, -1145.2992, 0)
ptsSpine0[7] = Geom::Point3d.new(188.2728, -1139.7576, 0)
ptsSpine0[8] = Geom::Point3d.new(220.542, -1135.9572, 0)
ptsSpine0[9] = Geom::Point3d.new(252.9696, -1133.9088, 0)
ptsSpine0[10] = Geom::Point3d.new(285.4608, -1133.6088, 0)
ptsSpine0[11] = Geom::Point3d.new(292.6584, -1133.7816, 0)
ptsSpine0[12] = Geom::Point3d.new(325.098, -1135.6524, 0)
ptsSpine0[13] = Geom::Point3d.new(357.3888, -1139.2644, 0)
ptsSpine0[14] = Geom::Point3d.new(389.436, -1144.62, 0)
ptsSpine0[15] = Geom::Point3d.new(421.1472, -1151.7024, 0)
ptsSpine0[16] = Geom::Point3d.new(452.4276, -1160.49, 0)
ptsSpine0[17] = Geom::Point3d.new(483.1872, -1170.9588, 0)
ptsSpine0[18] = Geom::Point3d.new(513.3348, -1183.0776, 0)
ptsSpine0[19] = Geom::Point3d.new(542.7828, -1196.8104, 0)
ptsSpine0[20] = Geom::Point3d.new(571.4424, -1212.12, 0)
ptsSpine0[21] = Geom::Point3d.new(574.56, -1213.92, 0)
edge = entities.add_edges(ptsSpine0)
face.followme(edge)
# Create a material and assign the texture to it
material = model.materials.add("Test Material")
material.texture = "/Users/jeffreygunderson/Library/Application Support/SketchUp 2022/SketchUp/TESTImage.jpg"
face.position_material(material, ptsSpine0, true)